@whatwg-node/node-fetch 0.7.22-alpha-20250527001401-318441d4ecce8b4db24c1d2d9a90cfb84928b021 → 0.7.22-alpha-20250527014600-33a0363f582926116cdd12dd455c7db8f571dbfe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Body.js +7 -7
- package/esm/Body.js +7 -7
- package/package.json +1 -1
package/cjs/Body.js
CHANGED
@@ -225,10 +225,10 @@ class PonyfillBody {
|
|
225
225
|
});
|
226
226
|
bb.on('field', (name, value, fieldnameTruncated, valueTruncated) => {
|
227
227
|
if (fieldnameTruncated) {
|
228
|
-
|
228
|
+
bb.destroy(new Error(`Field name size exceeded: ${formDataLimits?.fieldNameSize} bytes`));
|
229
229
|
}
|
230
230
|
if (valueTruncated) {
|
231
|
-
|
231
|
+
bb.destroy(new Error(`Field value size exceeded: ${formDataLimits?.fieldSize} bytes`));
|
232
232
|
}
|
233
233
|
this._formData.set(name, value);
|
234
234
|
});
|
@@ -238,24 +238,24 @@ class PonyfillBody {
|
|
238
238
|
chunks.push(chunk);
|
239
239
|
});
|
240
240
|
fileStream.on('limit', () => {
|
241
|
-
|
241
|
+
bb.destroy(new Error(`File size limit exceeded: ${formDataLimits?.fileSize} bytes`));
|
242
242
|
});
|
243
243
|
fileStream.on('close', () => {
|
244
244
|
if (fileStream.truncated) {
|
245
|
-
|
245
|
+
bb.destroy(new Error(`File size limit exceeded: ${formDataLimits?.fileSize} bytes`));
|
246
246
|
}
|
247
247
|
const file = new File_js_1.PonyfillFile(chunks, filename, { type: mimeType });
|
248
248
|
this._formData.set(name, file);
|
249
249
|
});
|
250
250
|
});
|
251
251
|
bb.on('fieldsLimit', () => {
|
252
|
-
|
252
|
+
bb.destroy(new Error(`Fields limit exceeded: ${formDataLimits?.fields}`));
|
253
253
|
});
|
254
254
|
bb.on('filesLimit', () => {
|
255
|
-
|
255
|
+
bb.destroy(new Error(`Files limit exceeded: ${formDataLimits?.files}`));
|
256
256
|
});
|
257
257
|
bb.on('partsLimit', () => {
|
258
|
-
|
258
|
+
bb.destroy(new Error(`Parts limit exceeded: ${formDataLimits?.parts}`));
|
259
259
|
});
|
260
260
|
return (0, promises_1.pipeline)(stream, bb, {
|
261
261
|
signal: this._signal || undefined,
|
package/esm/Body.js
CHANGED
@@ -222,10 +222,10 @@ export class PonyfillBody {
|
|
222
222
|
});
|
223
223
|
bb.on('field', (name, value, fieldnameTruncated, valueTruncated) => {
|
224
224
|
if (fieldnameTruncated) {
|
225
|
-
|
225
|
+
bb.destroy(new Error(`Field name size exceeded: ${formDataLimits?.fieldNameSize} bytes`));
|
226
226
|
}
|
227
227
|
if (valueTruncated) {
|
228
|
-
|
228
|
+
bb.destroy(new Error(`Field value size exceeded: ${formDataLimits?.fieldSize} bytes`));
|
229
229
|
}
|
230
230
|
this._formData.set(name, value);
|
231
231
|
});
|
@@ -235,24 +235,24 @@ export class PonyfillBody {
|
|
235
235
|
chunks.push(chunk);
|
236
236
|
});
|
237
237
|
fileStream.on('limit', () => {
|
238
|
-
|
238
|
+
bb.destroy(new Error(`File size limit exceeded: ${formDataLimits?.fileSize} bytes`));
|
239
239
|
});
|
240
240
|
fileStream.on('close', () => {
|
241
241
|
if (fileStream.truncated) {
|
242
|
-
|
242
|
+
bb.destroy(new Error(`File size limit exceeded: ${formDataLimits?.fileSize} bytes`));
|
243
243
|
}
|
244
244
|
const file = new PonyfillFile(chunks, filename, { type: mimeType });
|
245
245
|
this._formData.set(name, file);
|
246
246
|
});
|
247
247
|
});
|
248
248
|
bb.on('fieldsLimit', () => {
|
249
|
-
|
249
|
+
bb.destroy(new Error(`Fields limit exceeded: ${formDataLimits?.fields}`));
|
250
250
|
});
|
251
251
|
bb.on('filesLimit', () => {
|
252
|
-
|
252
|
+
bb.destroy(new Error(`Files limit exceeded: ${formDataLimits?.files}`));
|
253
253
|
});
|
254
254
|
bb.on('partsLimit', () => {
|
255
|
-
|
255
|
+
bb.destroy(new Error(`Parts limit exceeded: ${formDataLimits?.parts}`));
|
256
256
|
});
|
257
257
|
return pipeline(stream, bb, {
|
258
258
|
signal: this._signal || undefined,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@whatwg-node/node-fetch",
|
3
|
-
"version": "0.7.22-alpha-
|
3
|
+
"version": "0.7.22-alpha-20250527014600-33a0363f582926116cdd12dd455c7db8f571dbfe",
|
4
4
|
"description": "Fetch API implementation for Node",
|
5
5
|
"sideEffects": false,
|
6
6
|
"dependencies": {
|