0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-12 04:52:26 +01:00

fix dict handling for make_request()

This commit is contained in:
Richard van der Hoff 2020-11-13 23:48:25 +00:00
parent 9debe657a3
commit 70c0d47989
2 changed files with 2 additions and 3 deletions

View file

@ -193,6 +193,8 @@ def make_request(
if not path.startswith(b"/"): if not path.startswith(b"/"):
path = b"/" + path path = b"/" + path
if isinstance(content, dict):
content = json.dumps(content).encode("utf8")
if isinstance(content, str): if isinstance(content, str):
content = content.encode("utf8") content = content.encode("utf8")

View file

@ -429,9 +429,6 @@ class HomeserverTestCase(TestCase):
Returns: Returns:
Tuple[synapse.http.site.SynapseRequest, channel] Tuple[synapse.http.site.SynapseRequest, channel]
""" """
if isinstance(content, dict):
content = json.dumps(content).encode("utf8")
return make_request( return make_request(
self.reactor, self.reactor,
self.site, self.site,