Extract httputils.redirect
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user