Skip to content

Commit 35f5d45

Browse files
authored
fix: fetch body fallback random number generation (nodejs#4023)
1 parent 8ef4c79 commit 35f5d45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/web/fetch/body.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
const crypto = require('node:crypto')
2424
random = (max) => crypto.randomInt(0, max)
2525
} catch {
26-
random = (max) => Math.floor(Math.random(max))
26+
random = (max) => Math.floor(Math.random() * max)
2727
}
2828

2929
const textEncoder = new TextEncoder()

0 commit comments

Comments
 (0)