mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-29 16:55:32 +00:00
web.internal: Use absolute path for redirect
This commit is contained in:
parent
77a3ea7529
commit
9b76b70d06
2 changed files with 3 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue