Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
CSP: Fix script-src-elem policies in workers
https://bugs.webkit.org/show_bug.cgi?id=239840 Reviewed by Kate Cheney. Source/WebCore: Test: http/tests/security/contentSecurityPolicy/script-src-strict-dynamic-and-script-src-elem.html * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript const): LayoutTests: CSP: Fix script-src-elem policies in workers * http/tests/security/contentSecurityPolicy/script-src-strict-dynamic-and-script-src-elem-expected.txt: Added. * http/tests/security/contentSecurityPolicy/script-src-strict-dynamic-and-script-src-elem.html: Added. Canonical link: https://commits.webkit.org/250386@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,2 @@ | ||
| ALERT: importScripts allowed | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,28 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <script> | ||
| if (window.testRunner) { | ||
| testRunner.waitUntilDone(); | ||
| testRunner.dumpAsText(); | ||
| } | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <script> | ||
| try { | ||
| var worker = new Worker('http://127.0.0.1:8000/security/contentSecurityPolicy/resources/worker.py?type=importscripts&csp=' + | ||
| encodeURIComponent("script-src 'strict-dynamic'; script-src-elem localhost:8000")); | ||
| worker.onmessage = function (event) { | ||
| alert(event.data); | ||
| if (window.testRunner) | ||
| testRunner.notifyDone(); | ||
| }; | ||
| } catch (e) { | ||
| alert(e); | ||
| if (window.testRunner) | ||
| testRunner.notifyDone(); | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters