-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: if origin response has a csp with a nonce, ensure we are not ov…
…erriding it with a new value and that we are not adding any nonce attributes to the response body ourselves.
- Loading branch information
1 parent
d3e2c71
commit 2f5f109
Showing
3 changed files
with
107 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/ | ||
Content-Security-Policy: img-src 'self' blob: data:; script-src 'sha256-/Cb4VxgL2aVP0MVDvbP0DgEOUv+MeNQmZX4yXHkn/c0=' | ||
/pre-existing-csp-with-nonce.html | ||
Content-Security-Policy: img-src 'self' blob: data:; script-src 'nonce-meow' 'strict-dynamic' 'unsafe-inline' 'unsafe-eval' 'self' https: http: 'sha256-/Cb4VxgL2aVP0MVDvbP0DgEOUv+MeNQmZX4yXHkn/c0='; report-uri /.netlify/functions/__csp-violations |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<link rel="stylesheet" href="/main.css" /> | ||
<link class="does-not-have-nonce" rel="preload" as="script" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" /> | ||
<link class="has-nonce" nonce="nonce-meow" rel="preload" as="script" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js" /> | ||
</head> | ||
|
||
<body> | ||
<script class="has-nonce" nonce="nonce-meow" | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js"></script> | ||
<script class="does-not-have-nonce"> | ||
document.write("<p>❌ nay</p>"); | ||
</script> | ||
<script class="has-nonce" nonce="nonce-meow"> | ||
document.write("<p>✅ yay</p>"); | ||
confetti(); | ||
</script> | ||
<script class="does-not-have-nonce" nonce="nonce-meow" | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></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