Skip to content

Commit 0d214b8

Browse files
committed
Security fixes
1 parent bd4d732 commit 0d214b8

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

dist/index.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -39711,6 +39711,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(4978)
3971139711
const { File: UndiciFile } = __nccwpck_require__(8511)
3971239712
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
3971339713

39714+
let random
39715+
try {
39716+
const crypto = __nccwpck_require__(6005)
39717+
random = (max) => crypto.randomInt(0, max)
39718+
} catch {
39719+
random = (max) => Math.floor(Math.random(max))
39720+
}
39721+
3971439722
let ReadableStream = globalThis.ReadableStream
3971539723

3971639724
/** @type {globalThis['File']} */
@@ -39796,7 +39804,7 @@ function extractBody (object, keepalive = false) {
3979639804
// Set source to a copy of the bytes held by object.
3979739805
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
3979839806
} else if (util.isFormDataLike(object)) {
39799-
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
39807+
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
3980039808
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
3980139809

3980239810
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
@@ -54612,6 +54620,14 @@ module.exports = require("net");
5461254620

5461354621
/***/ }),
5461454622

54623+
/***/ 6005:
54624+
/***/ ((module) => {
54625+
54626+
"use strict";
54627+
module.exports = require("node:crypto");
54628+
54629+
/***/ }),
54630+
5461554631
/***/ 5673:
5461654632
/***/ ((module) => {
5461754633

package-lock.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)