summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-03-04 10:23:26 +0000
committerErik Johnston <erik@matrix.org>2021-03-04 10:23:26 +0000
commit61a970e25fc5e6dc1036b1bb4702ef8e6e44f419 (patch)
tree16fd89ce0b5b0efa51d29c61723401ee6429beb6 /synapse/http/matrixfederationclient.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parent 1.29.0rc1 (diff)
downloadsynapse-61a970e25fc5e6dc1036b1bb4702ef8e6e44f419.tar.xz
Merge remote-tracking branch 'origin/release-v1.29.0' into matrix-org-hotfixes
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r--synapse/http/matrixfederationclient.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py

index cde42e9f5e..0f107714ea 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -1049,14 +1049,14 @@ def check_content_type_is_json(headers: Headers) -> None: RequestSendFailed: if the Content-Type header is missing or isn't JSON """ - c_type = headers.getRawHeaders(b"Content-Type") - if c_type is None: + content_type_headers = headers.getRawHeaders(b"Content-Type") + if content_type_headers is None: raise RequestSendFailed( RuntimeError("No Content-Type header received from remote server"), can_retry=False, ) - c_type = c_type[0].decode("ascii") # only the first header + c_type = content_type_headers[0].decode("ascii") # only the first header val, options = cgi.parse_header(c_type) if val != "application/json": raise RequestSendFailed(