summary refs log tree commit diff
path: root/synapse/app/frontend_proxy.py
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-10-27 11:01:50 +0100
committerGitHub <noreply@github.com>2017-10-27 11:01:50 +0100
commit8b56977b6f4f34b5ad77f04a2544c153af9136c7 (patch)
tree2d2084622339e2228117f22beedf6058ad223056 /synapse/app/frontend_proxy.py
parentMerge pull request #2585 from matrix-org/rav/unstable_to_r0 (diff)
parentDocstring for post_urlencoded_get_json (diff)
downloadsynapse-8b56977b6f4f34b5ad77f04a2544c153af9136c7.tar.xz
Merge pull request #2586 from matrix-org/rav/frontend_proxy_auth_header
Front-end proxy: pass through auth header
Diffstat (limited to 'synapse/app/frontend_proxy.py')
-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 3f8c3feeb5..abc7ef5725 100644
--- a/synapse/app/frontend_proxy.py
+++ b/synapse/app/frontend_proxy.py
@@ -88,9 +88,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))