From 1952578f71e526e731f528d6a8f960ce8233e319 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 2 Jun 2023 12:43:44 +0200 Subject: [PATCH] Remove ? from path if no get parameters are given --- game.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/game.py b/game.py index b71350f..c8a289b 100755 --- a/game.py +++ b/game.py @@ -32,10 +32,15 @@ def log_the_request(response): else: referrer = request.referrer + if request.full_path[-1] == '?': + full_path = request.full_path[:-1] + else: + full_path = request.full_path + log = { 'remote_addr': request.remote_addr, 'remote_user': remote_user, - 'url': request.full_path, + 'url': full_path, 'date': now.strftime("%d/%b/%Y:%H:%M:%S %z"), 'referrer': referrer, 'user_agent': request.user_agent.string,