Skip to content

Instantly share code, notes, and snippets.

View jasisk's full-sized avatar
👋

Jean-Charles Sisk jasisk

👋
View GitHub Profile
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) {