mirror of
https://github.com/Kozea/Radicale.git
synced 2025-09-15 20:36:55 +00:00
remove base prefix from path (required for proper handling if called by reverse proxy)
This commit is contained in:
parent
7b4da3a128
commit
280968e694
2 changed files with 29 additions and 14 deletions
|
@ -66,6 +66,8 @@ class ApplicationPartGet(ApplicationBase):
|
|||
if path == "/.web" or path.startswith("/.web/"):
|
||||
# Redirect to sanitized path for all subpaths of /.web
|
||||
unsafe_path = environ.get("PATH_INFO", "")
|
||||
if len(base_prefix) > 0:
|
||||
unsafe_path = unsafe_path.removeprefix(base_prefix)
|
||||
if unsafe_path != path:
|
||||
location = base_prefix + path
|
||||
logger.info("Redirecting to sanitized path: %r ==> %r",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue