mirror of
https://github.com/sissbruecker/linkding.git
synced 2026-02-27 22:43:15 +08:00
Allow sandboxes scripts when viewing assets (#1252)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user