From 4e1b1b010baf591acb7fc5b62d645dea68aec293 Mon Sep 17 00:00:00 2001 From: Mikhail Chechnev Date: Wed, 11 Mar 2026 15:42:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A6=D0=98=D0=A2=D0=9A-795:=20CodeReview=20-?= =?UTF-8?q?=20http=5Fclient=20-=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D0=B9=20onError=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20secureSocket,=20=D0=B8=D0=B7=20=D0=B8=D0=BD=D1=82?= =?UTF-8?q?=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D0=B0=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D1=91=D0=BD=20=D1=8D=D0=BA=D1=81=D0=BF=D0=BE=D1=80=D1=82?= =?UTF-8?q?=20HttpError=20=20(=D0=BD=D0=B5=20=D0=B8=D1=81=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D1=82=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/http_client.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/http_client.js b/core/http_client.js index b46a2ab..dc088e7 100644 --- a/core/http_client.js +++ b/core/http_client.js @@ -477,16 +477,10 @@ const httpRequestThroughProxy = (requestOptions, targetUrl, headers, body, proxy //Разрешаем промис предварительно сформировав ответ, совместимый со старыми библиотекаим "Request" resolve(processResponse(result, options)); }); - //Слушаем сетевые ошибки на защищенном соединении - secureSocket.on("error", err => { - reject(err); - }); } ); //Слушаем сетевые ошибки на защищенном соединении - secureSocket.on("error", err => { - reject(err); - }); + secureSocket.on("error", err => reject(err)); } else { //Ответ на CONNECT-запрос содержит статус, отличный от 200 - отключаемся, не прошли прокси proxySocket.destroy(); @@ -637,5 +631,4 @@ const httpRequest = async (rawOptions = {}) => { // Интерфейс модуля //----------------- -exports.HttpError = HttpError; exports.httpRequest = httpRequest;