Module: check_mk
Branch: master
Commit: bc237061cc203708008f5d73549f096c71f48fde
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bc237061cc2037…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Jan 4 16:09:33 2019 +0100
Fix redirection test.
Quoting
https://en.wikipedia.org/wiki/HTTP_location:
An obsolete version of the HTTP 1.1 specifications (IETF RFC 2616)
required a complete absolute URI for redirection. The IETF HTTP
working group found that the most popular web browsers tolerate the
passing of a relative URL and, consequently, the updated HTTP 1.1
specifications (IETF RFC 7231) relaxed the original constraint,
allowing the use of relative URLs in Location headers.
To be on the safe side, werkzeug follows the old RFC and constructs an
absolute URI.
Change-Id: Ifb40c6a8fda07ce94e70477fe6dc5db334d46dfd
---
tests/integration/omd/test_web_access.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/integration/omd/test_web_access.py
b/tests/integration/omd/test_web_access.py
index b518047..5d9e2c2 100644
--- a/tests/integration/omd/test_web_access.py
+++ b/tests/integration/omd/test_web_access.py
@@ -28,15 +28,17 @@ 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)
# 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="/%s/check_mk/login.py?_origtarget=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="/%s/check_mk/login.py?_origtarget=index.py" %
site.id)
+ expected_code=302,
+ expected_target=expected_target)
def test_cmk_agents_access(site):