@whatwg-node/node-fetch 0.5.9 → 0.5.10-alpha-20240322103629-07f53b56429d0c2dcdb6dcd240226e0f599203e0
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/fetchCurl.js +9 -1
- package/esm/fetchCurl.js +9 -1
- package/package.json +1 -1
package/cjs/fetchCurl.js
CHANGED
@@ -56,7 +56,12 @@ function fetchCurl(fetchRequest) {
|
|
56
56
|
if (fetchRequest['_signal']) {
|
57
57
|
fetchRequest['_signal'].onabort = () => {
|
58
58
|
if (curlHandle.isOpen) {
|
59
|
-
|
59
|
+
try {
|
60
|
+
curlHandle.pause(CurlPause.Recv);
|
61
|
+
}
|
62
|
+
catch (e) {
|
63
|
+
reject(e);
|
64
|
+
}
|
60
65
|
}
|
61
66
|
};
|
62
67
|
}
|
@@ -68,6 +73,9 @@ function fetchCurl(fetchRequest) {
|
|
68
73
|
streamResolved.destroy(error);
|
69
74
|
}
|
70
75
|
else {
|
76
|
+
if (error.message === 'Operation was aborted by an application callback') {
|
77
|
+
error.message = 'The operation was aborted.';
|
78
|
+
}
|
71
79
|
reject(error);
|
72
80
|
}
|
73
81
|
curlHandle.close();
|
package/esm/fetchCurl.js
CHANGED
@@ -53,7 +53,12 @@ export function fetchCurl(fetchRequest) {
|
|
53
53
|
if (fetchRequest['_signal']) {
|
54
54
|
fetchRequest['_signal'].onabort = () => {
|
55
55
|
if (curlHandle.isOpen) {
|
56
|
-
|
56
|
+
try {
|
57
|
+
curlHandle.pause(CurlPause.Recv);
|
58
|
+
}
|
59
|
+
catch (e) {
|
60
|
+
reject(e);
|
61
|
+
}
|
57
62
|
}
|
58
63
|
};
|
59
64
|
}
|
@@ -65,6 +70,9 @@ export function fetchCurl(fetchRequest) {
|
|
65
70
|
streamResolved.destroy(error);
|
66
71
|
}
|
67
72
|
else {
|
73
|
+
if (error.message === 'Operation was aborted by an application callback') {
|
74
|
+
error.message = 'The operation was aborted.';
|
75
|
+
}
|
68
76
|
reject(error);
|
69
77
|
}
|
70
78
|
curlHandle.close();
|
package/package.json
CHANGED