1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-07-29 18:08:31 +00:00

Error if SCRIPT_NAME ends with '/'

This commit is contained in:
Unrud 2022-01-21 19:56:57 +01:00
parent fbeeb6d520
commit 5bc2d8f919
2 changed files with 14 additions and 0 deletions

View file

@ -65,6 +65,10 @@ permissions: RrWw""")
SCRIPT_NAME="/radicale")
assert headers.get("Location") == "/radicale/.web"
def test_root_broken_script_name(self) -> None:
"""GET request at "/" with SCRIPT_NAME ending with "/"."""
self.get("/", check=500, SCRIPT_NAME="/radicale/")
def test_root_http_x_script_name(self) -> None:
"""GET request at "/" with HTTP_X_SCRIPT_NAME."""
for path in ["", "/", "//"]:
@ -72,6 +76,10 @@ permissions: RrWw""")
HTTP_X_SCRIPT_NAME="/radicale")
assert headers.get("Location") == "/radicale/.web"
def test_root_broken_http_x_script_name(self) -> None:
"""GET request at "/" with HTTP_X_SCRIPT_NAME ending with "/"."""
self.get("/", check=400, HTTP_X_SCRIPT_NAME="/radicale/")
def test_sanitized_path(self) -> None:
"""GET request with unsanitized paths."""
for path, sane_path in [