Skip to content

Commit c900d18

Browse files
authored
Fix OIDC login regression (#17031)
Requests may require a User-Agent header, and the change in #16972 accidentally removed it, resulting in requests getting rejected causing login to fail.
1 parent b5322b4 commit c900d18

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

changelog.d/17031.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OIDC: try to JWT decode userinfo response if JSON parsing failed.

synapse/http/client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ async def request(
390390
cooperator=self._cooperator,
391391
)
392392

393+
# Always make sure we add a user agent to the request
394+
if headers is None:
395+
headers = Headers()
396+
397+
if not headers.hasHeader("User-Agent"):
398+
headers.addRawHeader("User-Agent", self.user_agent)
399+
393400
request_deferred: defer.Deferred = treq.request(
394401
method,
395402
uri,

0 commit comments

Comments
 (0)