summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-03-03 15:47:38 -0500
committerGitHub <noreply@github.com>2021-03-03 15:47:38 -0500
commit33a02f0f52a5cd793c0d123463d8a7a1e3f4f198 (patch)
tree0d53722ffb90376b2998bdf2f206e3b9d76da9d3 /synapse/http/matrixfederationclient.py
parentSet X-Forwarded-Proto header when frontend-proxy proxies a request (#9539) (diff)
downloadsynapse-33a02f0f52a5cd793c0d123463d8a7a1e3f4f198.tar.xz
Fix additional type hints from Twisted upgrade. (#9518)
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(