Stop passing bytes when dumping JSON (#7799)

This commit is contained in:
Patrick Cloke 2020-07-08 07:14:56 -04:00 committed by GitHub
parent e0c0129693
commit ff0680f69d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View file

@ -562,13 +562,17 @@ class MatrixFederationHttpClient(object):
Returns:
list[bytes]: a list of headers to be added as "Authorization:" headers
"""
request = {"method": method, "uri": url_bytes, "origin": self.server_name}
request = {
"method": method.decode("ascii"),
"uri": url_bytes.decode("ascii"),
"origin": self.server_name,
}
if destination is not None:
request["destination"] = destination
request["destination"] = destination.decode("ascii")
if destination_is is not None:
request["destination_is"] = destination_is
request["destination_is"] = destination_is.decode("ascii")
if content is not None:
request["content"] = content