From 45d1871f169c0f6831f6d81c56b960f55e9f8812 Mon Sep 17 00:00:00 2001 From: andrurodr Date: Mon, 7 Mar 2022 10:31:37 -0300 Subject: [PATCH] version --- lib/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/main.js b/lib/main.js index 00e4aa23..5d3a7891 100644 --- a/lib/main.js +++ b/lib/main.js @@ -69,12 +69,12 @@ function wrapWebhook(webhook, payload) { const fullProxy = process.env['http_proxy'] || process.env['HTTP_PROXY'] || process.env['https_proxy'] || process.env['HTTPS_PROXY']; const host = fullProxy ? fullProxy.split(':')[0] : ''; const port = fullProxy ? parseInt(fullProxy.split(':')[1]) : ''; - let proxy = host && port ? { proxy: { host, port } } : {}; - if (fullProxy) { - const agent = new https_proxy_agent_1.HttpsProxyAgent(fullProxy); + let proxy = host && port ? { proxy: { host, port } } : null; + if (proxy) { + const agent = new https_proxy_agent_1.HttpsProxyAgent({ host, port, rejectUnauthorized: false }); proxy = Object.assign(Object.assign({}, proxy), { httpAgent: agent, httpsAgent: agent }); } - const client = axios_1.default.create(proxy); + const client = axios_1.default.create(Object.assign(Object.assign({}, proxy), { maxRedirects: 0, timeout: 0 })); client.interceptors.request.use((config) => { utils_1.logInfo(JSON.stringify(config)); return config;