From fa112592fa306f5d75ce94d840969835f2d02302 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 8 Mar 2020 13:40:32 -0700 Subject: Correct malformed query strings: change ? to & so flask parses it correctly. Otherwise, parameters starting with ? will be included in the video id, which messes up the comments since the extraneous data is passed into the the ctoken. --- server.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server.py') diff --git a/server.py b/server.py index ac30156..5a68928 100644 --- a/server.py +++ b/server.py @@ -74,6 +74,9 @@ def error_code(code, start_response): def site_dispatch(env, start_response): client_address = env['REMOTE_ADDR'] try: + # correct malformed query string with ? separators instead of & + env['QUERY_STRING'] = env['QUERY_STRING'].replace('?', '&') + method = env['REQUEST_METHOD'] path = env['PATH_INFO'] -- cgit v1.2.3