mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-10 18:40:53 +00:00
Redirect GET and HEAD requests to sanitized path
This commit is contained in:
parent
6dee974b74
commit
b93842b10c
4 changed files with 29 additions and 17 deletions
|
@ -62,13 +62,10 @@ class ApplicationPartGet(ApplicationBase):
|
|||
"""Manage GET request."""
|
||||
# Redirect to .web if the root URL is requested
|
||||
if not pathutils.strip_path(path):
|
||||
web_path = ".web"
|
||||
if not environ.get("PATH_INFO"):
|
||||
web_path = posixpath.join(posixpath.basename(base_prefix),
|
||||
web_path)
|
||||
location = ".web"
|
||||
return (client.FOUND,
|
||||
{"Location": web_path, "Content-Type": "text/plain"},
|
||||
"Redirected to %s" % web_path)
|
||||
{"Location": location, "Content-Type": "text/plain"},
|
||||
"Redirected to %s" % location)
|
||||
# Dispatch .web URL to web module
|
||||
if path == "/.web" or path.startswith("/.web/"):
|
||||
return self._web.get(environ, base_prefix, path, user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue