mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
http,https: fix double ERR_PROXY_TUNNEL emission
Fixes: https://github.com/nodejs/node/issues/60697 PR-URL: https://github.com/nodejs/node/pull/60699 Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
This commit is contained in:
@@ -284,9 +284,8 @@ function handleSocketAfterProxy(err, req) {
|
||||
if (err.code === 'ERR_PROXY_TUNNEL') {
|
||||
if (err.proxyTunnelTimeout) {
|
||||
req.emit('timeout'); // Propagate the timeout from the tunnel to the request.
|
||||
} else {
|
||||
req.emit('error', err);
|
||||
}
|
||||
req.emit('error', err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -958,7 +958,8 @@ function onSocketNT(req, socket, err) {
|
||||
if (!req.aborted && !err) {
|
||||
err = new ConnResetException('socket hang up');
|
||||
}
|
||||
if (err) {
|
||||
// ERR_PROXY_TUNNEL is handled by the proxying logic
|
||||
if (err && err.code !== 'ERR_PROXY_TUNNEL') {
|
||||
emitErrorEvent(req, err);
|
||||
}
|
||||
req._closed = true;
|
||||
|
||||
Reference in New Issue
Block a user