summary refs log tree commit diff
path: root/tests/server.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-11-01 12:48:12 +0000
committerDavid Robertson <davidr@element.io>2022-11-01 12:48:12 +0000
commit03ba8c83bea058f8f7246c9b720d0baa2dbd33c1 (patch)
treeecc52699be57454b2e4a429327cb60008d64f2d7 /tests/server.py
parentMerge branch 'release-v1.70' into matrix-org-hotfixes (diff)
parentAdjust changelog (diff)
downloadsynapse-03ba8c83bea058f8f7246c9b720d0baa2dbd33c1.tar.xz
Merge branch 'release-v1.71' into matrix-org-hotfixes
Diffstat (limited to 'tests/server.py')
-rw-r--r--tests/server.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/server.py b/tests/server.py
index 8b1d186219..b1730fcc8d 100644
--- a/tests/server.py
+++ b/tests/server.py
@@ -362,6 +362,12 @@ def make_request(
     # Twisted expects to be at the end of the content when parsing the request.
     req.content.seek(0, SEEK_END)
 
+    # Old version of Twisted (<20.3.0) have issues with parsing x-www-form-urlencoded
+    # bodies if the Content-Length header is missing
+    req.requestHeaders.addRawHeader(
+        b"Content-Length", str(len(content)).encode("ascii")
+    )
+
     if access_token:
         req.requestHeaders.addRawHeader(
             b"Authorization", b"Bearer " + access_token.encode("ascii")