mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-29 16:55:32 +00:00
Extract httputils.redirect
This commit is contained in:
parent
113eeec847
commit
9e9f2bb780
4 changed files with 10 additions and 12 deletions
|
@ -75,10 +75,7 @@ class Web(web.BaseWeb):
|
|||
path, e, exc_info=True)
|
||||
return httputils.NOT_FOUND
|
||||
if os.path.isdir(filesystem_path) and not path.endswith("/"):
|
||||
location = posixpath.basename(path) + "/"
|
||||
return (client.FOUND,
|
||||
{"Location": location, "Content-Type": "text/plain"},
|
||||
"Redirected to %s" % location)
|
||||
return httputils.redirect(posixpath.basename(path) + "/")
|
||||
if os.path.isdir(filesystem_path):
|
||||
filesystem_path = os.path.join(filesystem_path, "index.html")
|
||||
if not os.path.isfile(filesystem_path):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue