diff options
author | David Robertson <davidr@element.io> | 2022-10-28 17:04:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-28 16:04:02 +0000 |
commit | 730b13dbc9e48181b1aaf38be870ec21364b1e9c (patch) | |
tree | f4ddcbec8e5e68a2780318985eafd4891b737fae /synapse/app | |
parent | Switch search SQL to triple-quote strings. (#14311) (diff) | |
download | synapse-730b13dbc9e48181b1aaf38be870ec21364b1e9c.tar.xz |
Improve `RawHeaders` type hints (#14303)
Diffstat (limited to 'synapse/app')
-rw-r--r-- | synapse/app/generic_worker.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py index 2a9f039367..cb5892f041 100644 --- a/synapse/app/generic_worker.py +++ b/synapse/app/generic_worker.py @@ -178,13 +178,13 @@ class KeyUploadServlet(RestServlet): # Proxy headers from the original request, such as the auth headers # (in case the access token is there) and the original IP / # User-Agent of the request. - headers = { - header: request.requestHeaders.getRawHeaders(header, []) + headers: Dict[bytes, List[bytes]] = { + header: list(request.requestHeaders.getRawHeaders(header, [])) for header in (b"Authorization", b"User-Agent") } # Add the previous hop to the X-Forwarded-For header. - x_forwarded_for = request.requestHeaders.getRawHeaders( - b"X-Forwarded-For", [] + x_forwarded_for = list( + request.requestHeaders.getRawHeaders(b"X-Forwarded-For", []) ) # we use request.client here, since we want the previous hop, not the # original client (as returned by request.getClientAddress()). |