Service URL: keep blank GET arguments

When a service URL contains GET arguments with no associated value, eg
  http://example.com/?foo=a&bar
only the arguments with value are kept, yielding
  http://example.com/?foo=a&ticket=<TICKET>
losing `bar` in the process
This commit is contained in:
Théophile Bastian 2020-04-14 23:47:08 +02:00 committed by Valentin Samir
parent 9cd44aa8aa
commit b7c7c0f0ba

View File

@ -259,7 +259,7 @@ def update_url(url, params):
value = value.encode('utf-8')
params[key] = value
url_parts = list(urlparse(url))
query = dict(parse_qsl(url_parts[4]))
query = dict(parse_qsl(url_parts[4], keep_blank_values=True))
query.update(params)
# make the params order deterministic
query = list(query.items())