diff --git a/radicale/tests/test_web.py b/radicale/tests/test_web.py index 88bf2bcd..ecfec9a9 100644 --- a/radicale/tests/test_web.py +++ b/radicale/tests/test_web.py @@ -26,9 +26,8 @@ class TestBaseWebRequests(BaseTest): """Test web plugin.""" def test_internal(self) -> None: - _, headers, answer = self.request("GET", "/.web", check=302) - assert headers.get("Location") == ".web/" - assert answer == "Redirected to .web/" + _, headers, _ = self.request("GET", "/.web", check=302) + assert headers.get("Location") == "/.web/" _, answer = self.get("/.web/") assert answer self.post("/.web", check=405) diff --git a/radicale/web/internal.py b/radicale/web/internal.py index 4ee62c81..d8f078b0 100644 --- a/radicale/web/internal.py +++ b/radicale/web/internal.py @@ -27,7 +27,6 @@ Features: import os -import posixpath import time from http import client from typing import Mapping @@ -75,7 +74,7 @@ class Web(web.BaseWeb): path, e, exc_info=True) return httputils.NOT_FOUND if os.path.isdir(filesystem_path) and not path.endswith("/"): - return httputils.redirect(posixpath.basename(path) + "/") + return httputils.redirect(base_prefix + path + "/") if os.path.isdir(filesystem_path): filesystem_path = os.path.join(filesystem_path, "index.html") if not os.path.isfile(filesystem_path):