Skip to content

Commit

Permalink
Set default csp policy
Browse files Browse the repository at this point in the history
Previously there was no default set so
any files could be loaded from anywhere
(except for scripts which were allow-listed).

This changes the csp so that by default
only localhost can be used. This should
detect issues like guybedford#290.
  • Loading branch information
iainbeeston committed May 16, 2022
1 parent cde9361 commit 79e2922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test-csp.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'nonce-asdf' unpkg.com;" />
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'nonce-asdf' unpkg.com;" />
<link rel="stylesheet" type="text/css" href="../node_modules/mocha/mocha.css"/>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="https://unpkg.com/construct-style-sheets-polyfill@3.0.0/dist/adoptedStyleSheets.js"></script>
Expand Down

0 comments on commit 79e2922

Please sign in to comment.