summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-10-26 18:14:57 +0100
committerRichard van der Hoff <richard@matrix.org>2017-10-26 18:19:01 +0100
commit54a2525133fdd5cb8de6d7af648c13186969e018 (patch)
tree948bbc54e47a9f74988a596dcd4eff29e8b57bb2 /synapse/app
parentSimpleHTTPClient: add support for headers (diff)
downloadsynapse-54a2525133fdd5cb8de6d7af648c13186969e018.tar.xz
Front-end proxy: pass through auth header
So that access-token-in-an-auth-header works.
Diffstat (limited to 'synapse/app')
-rw-r--r--synapse/app/frontend_proxy.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/app/frontend_proxy.py b/synapse/app/frontend_proxy.py
index bee4c47498..d2fb3bc454 100644
--- a/synapse/app/frontend_proxy.py
+++ b/synapse/app/frontend_proxy.py
@@ -89,9 +89,16 @@ class KeyUploadServlet(RestServlet):
 
         if body:
             # They're actually trying to upload something, proxy to main synapse.
+            # Pass through the auth headers, if any, in case the access token
+            # is there.
+            auth_headers = request.requestHeaders.getRawHeaders("Authorization", [])
+            headers = {
+                "Authorization": auth_headers,
+            }
             result = yield self.http_client.post_json_get_json(
                 self.main_uri + request.uri,
                 body,
+                headers=headers,
             )
 
             defer.returnValue((200, result))