summary refs log tree commit diff
path: root/synapse/rest/media/v1/download_resource.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-11-02 14:49:28 +0000
committerGitHub <noreply@github.com>2016-11-02 14:49:28 +0000
commit80d5d3baa1b9d32060ac2ed5bc0f216b827beac3 (patch)
tree170d1f2d10048bd07ec371e67b323ec21e698634 /synapse/rest/media/v1/download_resource.py
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
parentSet CORs headers on responses from the media repo (diff)
downloadsynapse-80d5d3baa1b9d32060ac2ed5bc0f216b827beac3.tar.xz
Merge pull request #1190 from matrix-org/markjh/media_cors
Set CORs headers on responses from the media repo
Diffstat (limited to 'synapse/rest/media/v1/download_resource.py')
-rw-r--r--synapse/rest/media/v1/download_resource.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/download_resource.py b/synapse/rest/media/v1/download_resource.py
index a45ee9483e..dfb87ffd15 100644
--- a/synapse/rest/media/v1/download_resource.py
+++ b/synapse/rest/media/v1/download_resource.py
@@ -15,7 +15,7 @@
 
 from ._base import parse_media_id, respond_with_file, respond_404
 from twisted.web.resource import Resource
-from synapse.http.server import request_handler
+from synapse.http.server import request_handler, set_cors_headers
 
 from twisted.web.server import NOT_DONE_YET
 from twisted.internet import defer
@@ -45,6 +45,7 @@ class DownloadResource(Resource):
     @request_handler()
     @defer.inlineCallbacks
     def _async_render_GET(self, request):
+        set_cors_headers(request)
         request.setHeader(
             "Content-Security-Policy",
             "default-src 'none';"