From 3a795d51662aa2d51495ec86f1d8416463bc376b Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Tue, 12 Jun 2018 10:05:04 -0400 Subject: [PATCH] Add a trailing slash to file links in the file tab This avoids a HTTP 301 redirect when trying to open a file from the file tab which was confusing reverse proxies with SSL termination. Change-Id: If1cdf11ff6e1e2bae146307a21c1a1aea31c51ed --- ara/tests/unit/test_utils.py | 6 ++++-- ara/utils.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ara/tests/unit/test_utils.py b/ara/tests/unit/test_utils.py index 70b5fc52..59cd7444 100644 --- a/ara/tests/unit/test_utils.py +++ b/ara/tests/unit/test_utils.py @@ -91,7 +91,9 @@ class TestUtils(TestAra): child = child['nodes'][0] self.assertEqual(child['text'], 'main.yml') self.assertEqual(child['dataAttr']['load'], - ctx['task_file'].id) + ctx['task_file'].id + '/') else: self.assertEqual(f['text'], 'playbook.yml') - self.assertEqual(f['dataAttr']['load'], ctx['pb_file'].id) + self.assertEqual( + f['dataAttr']['load'], ctx['pb_file'].id + '/' + ) diff --git a/ara/utils.py b/ara/utils.py index 41fed9d2..241abc2c 100644 --- a/ara/utils.py +++ b/ara/utils.py @@ -136,7 +136,7 @@ def generate_tree(root, paths, mock_os): node['dataAttr'] = { 'toggle': 'modal', 'target': '#file_modal', - 'load': paths[full_path] + 'load': paths[full_path] + '/' } tree.append(node) return tree