Use doseq=True when re-encoding query params in set_query_params

Otherwise, the list of values will be stringified and then URL encoded, resulting in something like locale=%5B%27en%27%5D

From parse_qs docs: Use the urllib.parse.urlencode() function (with the doseq parameter set to True) to convert such dictionaries into query strings.
pull/11234/head
Sage Abdullah 2023-11-14 12:23:29 +00:00
rodzic 7194b6c837
commit 4c057f0069
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: EB1A33CC51CC0217
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -68,5 +68,5 @@ def set_query_params(url: str, params: dict):
querydict = parse_qs(query)
querydict.update(params)
querydict = {key: value for key, value in querydict.items() if value is not None}
query = urlencode(querydict)
query = urlencode(querydict, doseq=True)
return urlunsplit((scheme, netloc, path, query, fragment))