Module: check_mk
Branch: master
Commit: 856cc3f66f02bb297bb6a9e0dbe884e6a1931882
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=856cc3f66f02bb…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Jan 7 09:01:30 2019 +0100
Fixed redirection URLs.
Change-Id: I332ba8acb9b5dd904d260c511b98f8c0728bfe44
---
tests/integration/omd/test_web_access.py | 13 +++++--------
web/app/index.wsgi | 2 ++
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/tests/integration/omd/test_web_access.py
b/tests/integration/omd/test_web_access.py
index 5d9e2c2..ddcebd5 100644
--- a/tests/integration/omd/test_web_access.py
+++ b/tests/integration/omd/test_web_access.py
@@ -28,17 +28,14 @@ def test_base_path_redirects(site):
def test_cmk_base_path_access(site):
web = CMKWebSession(site)
- expected_target = '%s://%s:%d/%s/check_mk/login.py?_origtarget=index.py' % \
- (site.http_proto, site.http_address, site.apache_port, site.id)
+ expected_target = "/%s/check_mk/login.py?_origtarget=index.py" % site.id
# TODO: Figure out if which status code we *really* expect here: 301 or 302?
- web.check_redirect("/%s/check_mk/" % site.id,
- expected_code=302,
- expected_target=expected_target)
+ web.check_redirect(
+ "/%s/check_mk/" % site.id, expected_code=302,
expected_target=expected_target)
- web.check_redirect("/%s/check_mk/index.py" % site.id,
- expected_code=302,
- expected_target=expected_target)
+ web.check_redirect(
+ "/%s/check_mk/index.py" % site.id, expected_code=302,
expected_target=expected_target)
def test_cmk_agents_access(site):
diff --git a/web/app/index.wsgi b/web/app/index.wsgi
index e681cf1..7f1fb36 100644
--- a/web/app/index.wsgi
+++ b/web/app/index.wsgi
@@ -70,6 +70,8 @@ class Application(object):
self._start_response = start_response
self._request = cmk.gui.http.Request(environ)
self._response = werkzeug.wrappers.Response()
+ # NOTE: Currently we rely on a *relavtive* Location header in redirects!
+ self._response.autocorrect_location_header = False
# Create an object that contains all data about the request and
# helper functions for creating valid HTML. Parse URI and