-
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.
fix: add nonce to link preload tags (#59)
- Loading branch information
Jason Barry
authored
Nov 1, 2023
1 parent
7808378
commit c097ee0
Showing
3 changed files
with
12 additions
and
7 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 |
---|---|---|
|
@@ -2,11 +2,12 @@ | |
<html> | ||
<head> | ||
<title>Using CSP Nonces on Script Tags</title> | ||
<style> | ||
body { | ||
font-family: sans-serif; | ||
} | ||
</style> | ||
<link rel="stylesheet" href="/main.css" /> | ||
<link | ||
rel="preload" | ||
as="script" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Using CSP Nonces on Script Tags</h1> | ||
|
@@ -40,7 +41,7 @@ <h1>Using CSP Nonces on Script Tags</h1> | |
"ipt>" + | ||
"document.write('<div>❌ Script tag from <code>document.write</code> has executed!</div>');" + | ||
"</scr" + | ||
"ipt>" | ||
"ipt>", | ||
); | ||
</script> | ||
<script> | ||
|
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,3 @@ | ||
body { | ||
font-family: sans-serif; | ||
} |
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