0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-19 00:11:47 +01:00

SYN-141: Encode query params as UTF-8.

This commit is contained in:
Mark Haines 2014-11-18 19:42:07 +00:00
parent a7f470d1d9
commit 3e54d70ae2

View file

@ -260,7 +260,13 @@ class MatrixHttpClient(BaseHttpClient):
"""
logger.debug("get_json args: %s", args)
query_bytes = urllib.urlencode(args, True)
encoded_args = {}
for k, vs in args.items():
if isinstance(vs, basestring):
vs = [vs]
encoded_args[k] = [v.encode("UTF-8") for v in vs]
query_bytes = urllib.urlencode(encoded_args, True)
logger.debug("Query bytes: %s Retry DNS: %s", args, retry_on_dns_fail)
def body_callback(method, url_bytes, headers_dict):