mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 07:33:47 +01:00
Set Content-Security-Policy
on media repo
This is to inform browsers that they should sandbox the returned media. This is particularly cruical for javascript/HTML files.
This commit is contained in:
parent
f90b3d83a3
commit
0af9e1a637
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue