node_modules: update (#344)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-10-10 17:27:57 +02:00
1 parent b099186883
commit 6e88c72525
63 files changed
+2863 -1227

No files matched your search

+23 -3
View File
@@ -43,6 +43,17 @@ const TLS_OPTION_KEYS = [
'sessionIdContext',
'sigalgs'
];
/**
* Marks an error of the request as a fetch error, unless it is a permission model
* denial, which keeps its own code (see ERR_ACCESS_DENIED)
*
* @param err Error to mark
*/
function setFetchCode(err) {
if (err.code !== errors.ERR_ACCESS_DENIED) {
err.code = errors.EFETCH;
}
}
/**
* Resolves a URL only if it is one this module is willing to request.
*
@@ -139,7 +150,7 @@ function nmfetch(url, options) {
return;
}
finished = true;
err.code = errors.EFETCH;
setFetchCode(err);
err.sourceUrl = url;
fetchRes.emit('error', err);
});
@@ -212,7 +223,7 @@ function nmfetch(url, options) {
catch (E) {
finished = true;
setImmediate(() => {
E.code = errors.EFETCH;
setFetchCode(E);
E.sourceUrl = url;
fetchRes.emit('error', E);
});
@@ -224,7 +235,7 @@ function nmfetch(url, options) {
return;
}
finished = true;
err.code = errors.EFETCH;
setFetchCode(err);
err.sourceUrl = sourceUrl;
fetchRes.emit('error', err);
req.abort();
@@ -234,6 +245,15 @@ function nmfetch(url, options) {
req.setTimeout(timeout, () => fail(new Error('Request Timeout')));
}
req.on('error', (err) => fail(err));
// a consumer that destroys the response stream before it ended does not want the rest of
// the body, release the request now instead of when the timeout fires
fetchRes.once('close', () => {
if (finished || fetchRes.readableEnded) {
return;
}
finished = true;
req.destroy();
});
req.on('response', res => {
let inflate;
if (finished) {