From 89b552a880b16b0bc786f46034677b9ef3f896da Mon Sep 17 00:00:00 2001 From: --unset Date: Tue, 16 Apr 2024 10:26:32 -0400 Subject: [PATCH] Redirect to /login if garbage is in query args --- app/classes/web/public_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/classes/web/public_handler.py b/app/classes/web/public_handler.py index 21e2d495..a3d89d25 100644 --- a/app/classes/web/public_handler.py +++ b/app/classes/web/public_handler.py @@ -48,7 +48,10 @@ class PublicHandler(BaseHandler): } if self.request.query: - page_data["query"] = self.request.query_arguments.get("next")[0].decode() + request_query = self.request.query_arguments.get("next") + if not request_query: + self.redirect("/login") + page_data["query"] = request_query[0].decode() # sensible defaults template = "public/404.html"