diff --git a/lib/main.js b/lib/main.js index 4231ac90..d2fa085b 100644 --- a/lib/main.js +++ b/lib/main.js @@ -65,7 +65,11 @@ function wrapWebhook(webhook, payload) { return function () { return __awaiter(this, void 0, void 0, function* () { try { - yield axios_1.default.post(webhook, payload, { maxRedirects: 20 }); + 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]) : ''; + const proxy = host && port ? { proxy: { host, port } } : {}; + yield axios_1.default.post(webhook, payload, proxy); } catch (e) { if (e.response) {