1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-12 20:30:57 +00:00

Verify that base_prefix starts with '/'

This commit is contained in:
Unrud 2022-01-22 00:34:38 +01:00
parent 340582f84c
commit 17a5e5b6e0
3 changed files with 9 additions and 6 deletions

View file

@ -67,7 +67,8 @@ permissions: RrWw""")
def test_root_broken_script_name(self) -> None:
"""GET request at "/" with SCRIPT_NAME ending with "/"."""
self.get("/", check=500, SCRIPT_NAME="/radicale/")
for script_name in ["/", "/radicale/", "radicale"]:
self.get("/", check=500, SCRIPT_NAME=script_name)
def test_root_http_x_script_name(self) -> None:
"""GET request at "/" with HTTP_X_SCRIPT_NAME."""
@ -78,7 +79,8 @@ permissions: RrWw""")
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/")
for script_name in ["/", "/radicale/", "radicale"]:
self.get("/", check=400, HTTP_X_SCRIPT_NAME=script_name)
def test_sanitized_path(self) -> None:
"""GET request with unsanitized paths."""