Skip to content

Commit c219633

Browse files
committed
fix: use nonce attribute
1 parent 64ac967 commit c219633

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/vite/src/client/client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export function updateStyle(id: string, content: string): void {
408408
if (cspNonce === undefined) {
409409
cspNonce =
410410
document.querySelector<HTMLMetaElement>('meta[property=csp-nonce]')
411-
?.content ?? null
411+
?.nonce ?? null
412412
}
413413
if (cspNonce) {
414414
style.setAttribute('nonce', cspNonce)

playground/css/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<meta property="csp-nonce" content="random" />
1+
<meta property="csp-nonce" nonce="random" />
22

33
<link rel="stylesheet" href="./linked.css" />
44

0 commit comments

Comments
 (0)