summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-23 16:24:53 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-23 16:24:53 +0100
commitc8e6ac4977464810685ccc46ac516750e6e86676 (patch)
tree7985bd584f182fb17f3589636829f713db679ff4 /synapse/http/matrixfederationclient.py
parentMerge commit 'a5daae2a5' into anoa/dinsic_release_1_31_0 (diff)
parentFix additional type hints from Twisted upgrade. (#9518) (diff)
downloadsynapse-c8e6ac4977464810685ccc46ac516750e6e86676.tar.xz
Merge commit '33a02f0f5' into anoa/dinsic_release_1_31_0
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(