summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-08-17 17:22:43 +0100
committerGitHub <noreply@github.com>2016-08-17 17:22:43 +0100
commit2a0d8f821929e0a74727ead806b0cce048aa5a16 (patch)
tree0b14a1131ee2d7d06fe3bb5680907f6336891ff0
parentMerge pull request #1011 from matrix-org/dbkr/contains_display_name_override (diff)
parentSet `Content-Security-Policy` on media repo (diff)
downloadsynapse-2a0d8f821929e0a74727ead806b0cce048aa5a16.tar.xz
Merge pull request #1021 from matrix-org/erikj/mediasecurity_policy
Set `Content-Security-Policy` on media repo
-rw-r--r--synapse/rest/media/v1/download_resource.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/download_resource.py b/synapse/rest/media/v1/download_resource.py
index 9f69620772..9f0625a822 100644
--- a/synapse/rest/media/v1/download_resource.py
+++ b/synapse/rest/media/v1/download_resource.py
@@ -45,6 +45,7 @@ class DownloadResource(Resource):
     @request_handler()
     @defer.inlineCallbacks
     def _async_render_GET(self, request):
+        request.setHeader("Content-Security-Policy", "sandbox")
         server_name, media_id, name = parse_media_id(request)
         if server_name == self.server_name:
             yield self._respond_local_file(request, media_id, name)