From 75ddfdb31df5e176bb9eb6e91e1545fced54737e Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 23 Apr 2022 02:07:51 +0200 Subject: Redirect if alias not terminated in path --- backend/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'backend') 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) -- cgit v1.2.3