Skip to content

Commit

Permalink
Fix OIDC login regression
Browse files Browse the repository at this point in the history
Requests may require a User-Agent header, and the change in #16972
accidentally removed it, resulting in requests getting rejected causing
login to fail.
  • Loading branch information
erikjohnston committed Mar 26, 2024
1 parent b5322b4 commit 0ba3f66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions synapse/http/client.py
Expand Up @@ -390,6 +390,13 @@ async def request(
cooperator=self._cooperator,
)

# Always make sure we add a user agent to the request
if headers is None:
headers = Headers()

if not headers.hasHeader("User-Agent"):
headers.addRawHeader("User-Agent", self.user_agent)

request_deferred: defer.Deferred = treq.request(
method,
uri,
Expand Down

0 comments on commit 0ba3f66

Please sign in to comment.