Allow sandboxes scripts when viewing assets (#1252)

This commit is contained in:
Sascha Ißbrücker
2025-12-30 11:34:04 +01:00
committed by GitHub
parent 12dd1d8bc6
commit ee1cf6596b
2 changed files with 3 additions and 3 deletions

View File

@@ -151,7 +151,7 @@ class BookmarkAssetViewTestCase(TestCase, BookmarkFactoryMixin):
response["Content-Disposition"],
f'inline; filename="{asset.display_name}.html"',
)
self.assertEqual(response["Content-Security-Policy"], "sandbox")
self.assertEqual(response["Content-Security-Policy"], "sandbox allow-scripts")
def test_uploaded_file_download_headers(self):
bookmark = self.setup_bookmark()
@@ -163,4 +163,4 @@ class BookmarkAssetViewTestCase(TestCase, BookmarkFactoryMixin):
response["Content-Disposition"],
f'inline; filename="{asset.display_name}"',
)
self.assertEqual(response["Content-Security-Policy"], "sandbox")
self.assertEqual(response["Content-Security-Policy"], "sandbox allow-scripts")

View File

@@ -33,7 +33,7 @@ def view(request, asset_id: int):
response = HttpResponse(content, content_type=asset.content_type)
response["Content-Disposition"] = f'inline; filename="{asset.download_name}"'
response["Content-Security-Policy"] = "sandbox"
response["Content-Security-Policy"] = "sandbox allow-scripts"
return response