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;