@whatwg-node/node-fetch 0.7.23-alpha-20250726084802-683ac7e676415a5d08903fcace71146b2a74a837 → 0.7.23-alpha-20250726085929-27dea3e7c5dae7285bf9c837cce54f387e269df2

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 CHANGED
@@ -130,10 +130,6 @@ class PonyfillBody {
130
130
  this._chunks = [];
131
131
  return (0, utils_js_1.fakePromise)(this._chunks);
132
132
  }
133
- if (_body.readable.destroyed) {
134
- this._chunks = [];
135
- return (0, utils_js_1.fakePromise)(this._chunks);
136
- }
137
133
  const chunks = [];
138
134
  return new Promise((resolve, reject) => {
139
135
  _body.readable.on('data', chunk => {
@@ -92,10 +92,10 @@ function fetchNodeHttp(fetchRequest) {
92
92
  return;
93
93
  }
94
94
  }
95
- outputStream ||= new node_stream_1.PassThrough({
96
- signal,
95
+ outputStream ||= new node_stream_1.PassThrough();
96
+ nodeResponse.pipe(outputStream, {
97
+ end: true,
97
98
  });
98
- nodeResponse.pipe(outputStream);
99
99
  const statusCode = nodeResponse.statusCode || 200;
100
100
  let statusText = nodeResponse.statusMessage || node_http_1.STATUS_CODES[statusCode];
101
101
  if (statusText == null) {
@@ -106,6 +106,7 @@ function fetchNodeHttp(fetchRequest) {
106
106
  statusText,
107
107
  headers: nodeResponse.headers,
108
108
  url: fetchRequest.url,
109
+ signal,
109
110
  });
110
111
  resolve(ponyfillResponse);
111
112
  });
package/esm/Body.js CHANGED
@@ -127,10 +127,6 @@ export class PonyfillBody {
127
127
  this._chunks = [];
128
128
  return fakePromise(this._chunks);
129
129
  }
130
- if (_body.readable.destroyed) {
131
- this._chunks = [];
132
- return fakePromise(this._chunks);
133
- }
134
130
  const chunks = [];
135
131
  return new Promise((resolve, reject) => {
136
132
  _body.readable.on('data', chunk => {
@@ -89,10 +89,10 @@ export function fetchNodeHttp(fetchRequest) {
89
89
  return;
90
90
  }
91
91
  }
92
- outputStream ||= new PassThrough({
93
- signal,
92
+ outputStream ||= new PassThrough();
93
+ nodeResponse.pipe(outputStream, {
94
+ end: true,
94
95
  });
95
- nodeResponse.pipe(outputStream);
96
96
  const statusCode = nodeResponse.statusCode || 200;
97
97
  let statusText = nodeResponse.statusMessage || STATUS_CODES[statusCode];
98
98
  if (statusText == null) {
@@ -103,6 +103,7 @@ export function fetchNodeHttp(fetchRequest) {
103
103
  statusText,
104
104
  headers: nodeResponse.headers,
105
105
  url: fetchRequest.url,
106
+ signal,
106
107
  });
107
108
  resolve(ponyfillResponse);
108
109
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.7.23-alpha-20250726084802-683ac7e676415a5d08903fcace71146b2a74a837",
3
+ "version": "0.7.23-alpha-20250726085929-27dea3e7c5dae7285bf9c837cce54f387e269df2",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {