aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2022-04-23 02:07:51 +0200
committercbdev <cb@cbcdn.com>2022-04-23 02:07:51 +0200
commit75ddfdb31df5e176bb9eb6e91e1545fced54737e (patch)
tree52bec329d7a95df39de917130816b2e3a5385ab3
parent6b7719b11f4a97dd8a7a34f5166dd410f8fa52cb (diff)
downloadcargohold-75ddfdb31df5e176bb9eb6e91e1545fced54737e.tar.gz
cargohold-75ddfdb31df5e176bb9eb6e91e1545fced54737e.tar.bz2
cargohold-75ddfdb31df5e176bb9eb6e91e1545fced54737e.zip
Redirect if alias not terminated in path
-rw-r--r--backend/main.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/main.py b/backend/main.py
index 085599c..76aca81 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -77,7 +77,11 @@ def route(path, env, session, post):
if not session:
return home()
- print(json.dumps(session))
+ #print(json.dumps(session))
+
+ # Redirect if no slash after alias
+ if len(path) == 1:
+ return ["", [('Content-Type','text/html'), ("Location", path[0] + "/")], "302 Redirect"]
if len(path) > 1 and path[1] == "upload":
return upload(session, post)