summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2024-03-26 13:42:09 +0000
committerErik Johnston <erik@matrix.org>2024-03-26 13:42:09 +0000
commit34878b6bc904e4fbcbc8b4a941c757c3d4628467 (patch)
tree85b420c94b9184cbac085c83158ff778255157f5
parent1.104.0rc1 (diff)
parentFix OIDC login regression (#17031) (diff)
downloadsynapse-34878b6bc904e4fbcbc8b4a941c757c3d4628467.tar.xz
Merge remote-tracking branch 'origin/develop' into release-v1.104
-rw-r--r--changelog.d/17031.feature1
-rw-r--r--synapse/http/client.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/changelog.d/17031.feature b/changelog.d/17031.feature
new file mode 100644
index 0000000000..0f28cbbcd6
--- /dev/null
+++ b/changelog.d/17031.feature
@@ -0,0 +1 @@
+OIDC: try to JWT decode userinfo response if JSON parsing failed.
diff --git a/synapse/http/client.py b/synapse/http/client.py
index 08a8634dae..4718517c97 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -390,6 +390,13 @@ class BaseHttpClient:
                         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,