Skip to content

Commit 3899598

Browse files
committed
Fix Cloudflare workers nonce generation
1 parent a13c758 commit 3899598

File tree

1 file changed

+3
-1
lines changed
  • packages/adapter-cloudflare-workers/files

1 file changed

+3
-1
lines changed

packages/adapter-cloudflare-workers/files/entry.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ async function handle(event) {
3636
rawBody: await read(request),
3737
headers: Object.fromEntries(request.headers),
3838
method: request.method,
39-
nonce: globalThis.GENERATE_NONCES && btoa(crypto.getRandomValues(new Uint32Array(2)))
39+
nonce:
40+
/* eslint-disable-line no-undef */ GENERATE_NONCES &&
41+
btoa(crypto.getRandomValues(new Uint32Array(2)))
4042
});
4143

4244
if (rendered) {

0 commit comments

Comments
 (0)