summary refs log tree commit diff
path: root/synapse/handlers/oidc_handler.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-23 17:28:38 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-23 17:28:38 +0100
commit8cb8c604e431edecd2f522a2f313e342da7349ed (patch)
treec3367a6843657e4cca981541d333a563b5e995c7 /synapse/handlers/oidc_handler.py
parentMerge commit 'a7a379006' into anoa/dinsic_release_1_31_0 (diff)
parentFix additional type hints from Twisted 21.2.0. (#9591) (diff)
downloadsynapse-8cb8c604e431edecd2f522a2f313e342da7349ed.tar.xz
Merge commit '55da8df07' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/handlers/oidc_handler.py')
-rw-r--r--synapse/handlers/oidc_handler.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/handlers/oidc_handler.py b/synapse/handlers/oidc_handler.py

index 825fadb76f..f5d1821127 100644 --- a/synapse/handlers/oidc_handler.py +++ b/synapse/handlers/oidc_handler.py
@@ -34,6 +34,7 @@ from pymacaroons.exceptions import ( from typing_extensions import TypedDict from twisted.web.client import readBody +from twisted.web.http_headers import Headers from synapse.config import ConfigError from synapse.config.oidc_config import ( @@ -538,7 +539,7 @@ class OidcProvider: """ metadata = await self.load_metadata() token_endpoint = metadata.get("token_endpoint") - headers = { + raw_headers = { "Content-Type": "application/x-www-form-urlencoded", "User-Agent": self._http_client.user_agent, "Accept": "application/json", @@ -552,10 +553,10 @@ class OidcProvider: body = urlencode(args, True) # Fill the body/headers with credentials - uri, headers, body = self._client_auth.prepare( - method="POST", uri=token_endpoint, headers=headers, body=body + uri, raw_headers, body = self._client_auth.prepare( + method="POST", uri=token_endpoint, headers=raw_headers, body=body ) - headers = {k: [v] for (k, v) in headers.items()} + headers = Headers({k: [v] for (k, v) in raw_headers.items()}) # Do the actual request # We're not using the SimpleHttpClient util methods as we don't want to