Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typed-rest-client

Package Overview
Dependencies
Maintainers
7
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typed-rest-client - npm Package Compare versions

Comparing version 1.8.1 to 1.8.3

6

HttpClient.js

@@ -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.

@@ -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.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc