You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1a711b2
Browse filesBrowse the repository at this point in the historyBrowse files
fix: reject a handleRequest nonce outside CSPNonce up front
Validate options.nonce before the middleware chain runs, next to the
renderMode pre-check: a string, or a { script, style } pair with both
keys, each a non-empty string or false. An empty value (undefined, null,
'') still means no nonce. Previously scriptNonce() silently dropped any
other value, leaving the tags without a nonce.
Co-authored-by: Cursor <[email protected]>
Copy file name to clipboardExpand all lines: .changeset/handle-request-nonce-pair.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@
2
2
'@solidjs/vite-plugin': patch
3
3
---
4
4
5
-
`handleRequest(request, { nonce })` accepts the `{ script, style }` form of `@solidjs/web`'s `CSPNonce` and uses its `script` value for the scripts the handler writes: the injected client-entry tag and the post-flush redirect fallback. A pair used to throw `TypeError: value.replace is not a function`. The option is now declared in the `virtual:solid-ssr-handler` types.
5
+
`handleRequest(request, { nonce })` accepts the `{ script, style }` form of `@solidjs/web`'s `CSPNonce` and uses its `script` value for the scripts the handler writes: the injected client-entry tag and the post-flush redirect fallback. A pair used to throw `TypeError: value.replace is not a function`. A value outside `CSPNonce` (anything but a string or a `{ script, style }` object with both keys, each a non-empty string or `false`) now rejects the call up front with an error naming the option, before the middleware chain runs; an empty value (`undefined`, `null` or `''`) still means no nonce. The option is now declared in the `virtual:solid-ssr-handler` types.
` throw new Error('[@solidjs/vite-plugin] ' + source + ' must be a string, a { script, style } object (each a non-empty string or false), or undefined; got ' + got);`,
1288
+
`}`,
1289
+
);
1290
+
1266
1291
// No `_$SC` bootstrap injection: the runtime's serialized
1267
1292
// server-component references self-bootstrap the registry (each
1268
1293
// hydration script's first reference carries it as an idempotent
@@ -1500,6 +1525,7 @@ export function startServe(
1500
1525
// rejects up front, before the chain runs, instead of being contained
1501
1526
// as a request failure.
1502
1527
` if (options.renderMode !== undefined) assertRenderMode(options.renderMode, 'handleRequest options.renderMode');`,
0 commit comments