From 4e58a2684e14874f8f68c13fb05918774f50229f Mon Sep 17 00:00:00 2001 From: Pramod <50309120+kspramod@users.noreply.github.com> Date: Tue, 7 Jul 2020 17:25:29 +1000 Subject: [PATCH] `ignoreProxy` for axios request handle `proxy` system when `http_proxy` variables are set. https://github.com/axios/axios/issues/1514#issuecomment-392650702 set `proxy: false` for axios config to handle proxy enabled systems --- lib/wait-on.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/wait-on.js b/lib/wait-on.js index a31681d..cbc910c 100644 --- a/lib/wait-on.js +++ b/lib/wait-on.js @@ -48,6 +48,7 @@ const WAIT_ON_SCHEMA = Joi.object({ password: Joi.string(), }), strictSSL: Joi.boolean().default(false), + ignoreProxy: Joi.boolean().default(false), followRedirect: Joi.boolean().default(true), // HTTP 3XX responses headers: Joi.object(), }); @@ -267,6 +268,7 @@ function createHTTP$({ validatedOpts, output }, resource) { reverse, simultaneous, strictSSL: rejectUnauthorized, + ignoreProxy, } = validatedOpts; const method = HTTP_GET_RE.test(resource) ? 'get' : 'head'; const url = resource.replace('-get:', ':'); @@ -284,6 +286,7 @@ function createHTTP$({ validatedOpts, output }, resource) { ...(followRedirect ? {} : { maxRedirects: 0 }), // defaults to 5 (enabled) ...(timeout && { timeout }), ...urlSocketOptions, + ...(ignoreProxy ? { proxy: false }: {}), // axios no proxy method, // by default it provides full response object // validStatus is 2xx unless followRedirect is true (default)