diff options
author | David Robertson <davidr@element.io> | 2022-11-01 12:48:12 +0000 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2022-11-01 12:48:12 +0000 |
commit | 03ba8c83bea058f8f7246c9b720d0baa2dbd33c1 (patch) | |
tree | ecc52699be57454b2e4a429327cb60008d64f2d7 /tests/server.py | |
parent | Merge branch 'release-v1.70' into matrix-org-hotfixes (diff) | |
parent | Adjust changelog (diff) | |
download | synapse-03ba8c83bea058f8f7246c9b720d0baa2dbd33c1.tar.xz |
Merge branch 'release-v1.71' into matrix-org-hotfixes
Diffstat (limited to 'tests/server.py')
-rw-r--r-- | tests/server.py | 6 |
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") |