@whatwg-node/node-fetch
Advanced tools
Comparing version 0.7.6-rc-20250109004037-2f553a39562fb5f9438f70e81cc156b2779b3bf6 to 0.7.6-rc-20250109194034-4a9c9e12475f34596f1226fd937e6d8eb11f410e
@@ -66,14 +66,15 @@ "use strict"; | ||
let streamResolved; | ||
if (fetchRequest['_signal']) { | ||
fetchRequest['_signal'].onabort = () => { | ||
if (curlHandle.isOpen) { | ||
try { | ||
curlHandle.pause(CurlPause.Recv); | ||
} | ||
catch (e) { | ||
deferredPromise.reject(e); | ||
} | ||
function onAbort() { | ||
if (curlHandle.isOpen) { | ||
try { | ||
curlHandle.pause(CurlPause.Recv); | ||
} | ||
}; | ||
catch (e) { | ||
deferredPromise.reject(e); | ||
} | ||
} | ||
} | ||
if (fetchRequest['_signal']) { | ||
fetchRequest['_signal'].addEventListener('abort', onAbort, { once: true }); | ||
} | ||
curlHandle.once('end', function endListener() { | ||
@@ -86,2 +87,5 @@ try { | ||
} | ||
if (fetchRequest['_signal']) { | ||
fetchRequest['_signal'].removeEventListener('abort', onAbort); | ||
} | ||
}); | ||
@@ -88,0 +92,0 @@ curlHandle.once('error', function errorListener(error) { |
@@ -63,14 +63,15 @@ import { PassThrough, Readable } from 'node:stream'; | ||
let streamResolved; | ||
if (fetchRequest['_signal']) { | ||
fetchRequest['_signal'].onabort = () => { | ||
if (curlHandle.isOpen) { | ||
try { | ||
curlHandle.pause(CurlPause.Recv); | ||
} | ||
catch (e) { | ||
deferredPromise.reject(e); | ||
} | ||
function onAbort() { | ||
if (curlHandle.isOpen) { | ||
try { | ||
curlHandle.pause(CurlPause.Recv); | ||
} | ||
}; | ||
catch (e) { | ||
deferredPromise.reject(e); | ||
} | ||
} | ||
} | ||
if (fetchRequest['_signal']) { | ||
fetchRequest['_signal'].addEventListener('abort', onAbort, { once: true }); | ||
} | ||
curlHandle.once('end', function endListener() { | ||
@@ -83,2 +84,5 @@ try { | ||
} | ||
if (fetchRequest['_signal']) { | ||
fetchRequest['_signal'].removeEventListener('abort', onAbort); | ||
} | ||
}); | ||
@@ -85,0 +89,0 @@ curlHandle.once('error', function errorListener(error) { |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.7.6-rc-20250109004037-2f553a39562fb5f9438f70e81cc156b2779b3bf6", | ||
"version": "0.7.6-rc-20250109194034-4a9c9e12475f34596f1226fd937e6d8eb11f410e", | ||
"description": "Fetch API implementation for Node", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
222805
5643