diff options
author | cbdev <cb@cbcdn.com> | 2022-04-23 02:07:51 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2022-04-23 02:07:51 +0200 |
commit | 75ddfdb31df5e176bb9eb6e91e1545fced54737e (patch) | |
tree | 52bec329d7a95df39de917130816b2e3a5385ab3 /backend | |
parent | 6b7719b11f4a97dd8a7a34f5166dd410f8fa52cb (diff) | |
download | cargohold-75ddfdb31df5e176bb9eb6e91e1545fced54737e.tar.gz cargohold-75ddfdb31df5e176bb9eb6e91e1545fced54737e.tar.bz2 cargohold-75ddfdb31df5e176bb9eb6e91e1545fced54737e.zip |
Redirect if alias not terminated in path
Diffstat (limited to 'backend')
-rw-r--r-- | backend/main.py | 6 |
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) |