typed-rest-client
Advanced tools
Comparing version 1.8.1 to 1.8.3
@@ -114,3 +114,3 @@ "use strict"; | ||
no_proxy.split(',').forEach(bypass => { | ||
this._httpProxyBypassHosts.push(new RegExp(bypass, 'i')); | ||
this._httpProxyBypassHosts.push(util.buildProxyBypassRegexFromEnv(bypass)); | ||
}); | ||
@@ -211,3 +211,5 @@ } | ||
catch (err) { | ||
if (err && err.code && NetworkRetryErrors.indexOf(err.code) > -1) { | ||
numTries++; | ||
if (err && err.code && NetworkRetryErrors.indexOf(err.code) > -1 && numTries < maxTries) { | ||
yield this._performExponentialBackoff(numTries); | ||
continue; | ||
@@ -214,0 +216,0 @@ } |
{ | ||
"name": "typed-rest-client", | ||
"version": "1.8.1", | ||
"version": "1.8.3", | ||
"description": "Node Rest and Http Clients for use with TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "./RestClient.js", |
@@ -21,2 +21,11 @@ /// <reference types="node" /> | ||
/** | ||
* Builds a RegExp to test urls against for deciding | ||
* wether to bypass proxy from an entry of the | ||
* environment variable setting NO_PROXY | ||
* | ||
* @param {string} bypass | ||
* @return {RegExp} | ||
*/ | ||
export declare function buildProxyBypassRegexFromEnv(bypass: string): RegExp; | ||
/** | ||
* Obtain Response's Content Charset. | ||
@@ -23,0 +32,0 @@ * Through inspecting `content-type` response header. |
22
Util.js
@@ -100,2 +100,24 @@ "use strict"; | ||
/** | ||
* Builds a RegExp to test urls against for deciding | ||
* wether to bypass proxy from an entry of the | ||
* environment variable setting NO_PROXY | ||
* | ||
* @param {string} bypass | ||
* @return {RegExp} | ||
*/ | ||
function buildProxyBypassRegexFromEnv(bypass) { | ||
try { | ||
// We need to keep this around for back-compat purposes | ||
return new RegExp(bypass, 'i'); | ||
} | ||
catch (err) { | ||
if (err instanceof SyntaxError && (bypass || "").startsWith("*")) { | ||
let wildcardEscaped = bypass.replace('*', '(.*)'); | ||
return new RegExp(wildcardEscaped, 'i'); | ||
} | ||
throw err; | ||
} | ||
} | ||
exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv; | ||
/** | ||
* Obtain Response's Content Charset. | ||
@@ -102,0 +124,0 @@ * Through inspecting `content-type` response header. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157259
1727