Created
June 18, 2026 21:30
-
-
Save jasisk/03dcc644dbe2a432ae69cee612778ac1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/node_modules/node-fetch/lib/index.es.js b/node_modules/node-fetch/lib/index.es.js | |
| index aae9799..ef123d6 100644 | |
| --- a/node_modules/node-fetch/lib/index.es.js | |
| +++ b/node_modules/node-fetch/lib/index.es.js | |
| @@ -1740,7 +1740,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) { | |
| // if a data listener is still present we didn't end cleanly | |
| const hasDataListener = socket && socket.listenerCount('data') > 0; | |
| - if (hasDataListener && !hadError) { | |
| + if (hasDataListener && !hadError && !response.complete) { | |
| const err = new Error('Premature close'); | |
| err.code = 'ERR_STREAM_PREMATURE_CLOSE'; | |
| errorCallback(err); | |
| diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js | |
| index 567ff5d..580872b 100644 | |
| --- a/node_modules/node-fetch/lib/index.js | |
| +++ b/node_modules/node-fetch/lib/index.js | |
| @@ -1744,7 +1744,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) { | |
| // if a data listener is still present we didn't end cleanly | |
| const hasDataListener = socket && socket.listenerCount('data') > 0; | |
| - if (hasDataListener && !hadError) { | |
| + if (hasDataListener && !hadError && !response.complete) { | |
| const err = new Error('Premature close'); | |
| err.code = 'ERR_STREAM_PREMATURE_CLOSE'; | |
| errorCallback(err); | |
| diff --git a/node_modules/node-fetch/lib/index.mjs b/node_modules/node-fetch/lib/index.mjs | |
| index 2863dd9..8a491b9 100644 | |
| --- a/node_modules/node-fetch/lib/index.mjs | |
| +++ b/node_modules/node-fetch/lib/index.mjs | |
| @@ -1738,7 +1738,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) { | |
| // if a data listener is still present we didn't end cleanly | |
| const hasDataListener = socket && socket.listenerCount('data') > 0; | |
| - if (hasDataListener && !hadError) { | |
| + if (hasDataListener && !hadError && !response.complete) { | |
| const err = new Error('Premature close'); | |
| err.code = 'ERR_STREAM_PREMATURE_CLOSE'; | |
| errorCallback(err); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment