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.
This commit is contained in:
James Taylor 2020-03-08 13:40:32 -07:00
parent af334a8ac7
commit fa112592fa

View File

@ -74,6 +74,9 @@ def error_code(code, start_response):
def site_dispatch(env, start_response): def site_dispatch(env, start_response):
client_address = env['REMOTE_ADDR'] client_address = env['REMOTE_ADDR']
try: try:
# correct malformed query string with ? separators instead of &
env['QUERY_STRING'] = env['QUERY_STRING'].replace('?', '&')
method = env['REQUEST_METHOD'] method = env['REQUEST_METHOD']
path = env['PATH_INFO'] path = env['PATH_INFO']