@whatwg-node/node-fetch 0.5.8 → 0.5.9-alpha-20240321100335-2a21e23626e787685b44e4ef16b60924f682eaf0
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/Request.js +4 -0
- package/esm/Request.js +4 -0
- package/package.json +1 -1
package/cjs/Request.js
CHANGED
@@ -62,6 +62,10 @@ class PonyfillRequest extends Body_js_1.PonyfillBody {
|
|
62
62
|
this.contentType = contentTypeInHeaders;
|
63
63
|
}
|
64
64
|
const contentLengthInHeaders = this.headers.get('content-length');
|
65
|
+
if (bodyInit == null && !contentLengthInHeaders) {
|
66
|
+
this.contentLength = 0;
|
67
|
+
this.headers.set('content-length', '0');
|
68
|
+
}
|
65
69
|
if (!contentLengthInHeaders) {
|
66
70
|
if (this.contentLength) {
|
67
71
|
this.headers.set('content-length', this.contentLength.toString());
|
package/esm/Request.js
CHANGED
@@ -59,6 +59,10 @@ export class PonyfillRequest extends PonyfillBody {
|
|
59
59
|
this.contentType = contentTypeInHeaders;
|
60
60
|
}
|
61
61
|
const contentLengthInHeaders = this.headers.get('content-length');
|
62
|
+
if (bodyInit == null && !contentLengthInHeaders) {
|
63
|
+
this.contentLength = 0;
|
64
|
+
this.headers.set('content-length', '0');
|
65
|
+
}
|
62
66
|
if (!contentLengthInHeaders) {
|
63
67
|
if (this.contentLength) {
|
64
68
|
this.headers.set('content-length', this.contentLength.toString());
|
package/package.json
CHANGED