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

proxy-chain

Package Overview
Dependencies
Maintainers
9
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-chain - npm Package Compare versions

Comparing version 1.0.0-beta.2 to 1.0.0-beta.3

32

build/tools.js

@@ -6,8 +6,2 @@ 'use strict';

});
exports.nodeify = exports.maybeAddProxyAuthorizationHeader = exports.PORT_SELECTION_CONFIG = exports.addHeader = exports.parseProxyAuthorizationHeader = exports.redactParsedUrl = exports.redactUrl = exports.parseUrl = exports.isInvalidHeader = exports.isHopByHopHeader = exports.parseHostHeader = undefined;
var _http_common = require('_http_common');
// eslint-disable-line
var HOST_HEADER_REGEX = /^((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9]))(:([0-9]+))?$/;

@@ -48,2 +42,26 @@

var TOKEN_REGEX = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
/**
* Verifies that the given val is a valid HTTP token per the rules defined in RFC 7230
* @see https://tools.ietf.org/html/rfc7230#section-3.2.6
* @see https://github.com/nodejs/node/blob/8cf5ae07e9e80747c19e0fc04fad48423707f62c/lib/_http_common.js#L222
*/
var isHttpToken = function isHttpToken(val) {
return TOKEN_REGEX.test(val);
};
var HEADER_CHAR_REGEX = /[^\t\x20-\x7e\x80-\xff]/;
/**
* True if val contains an invalid field-vchar
* field-value = *( field-content / obs-fold )
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
* field-vchar = VCHAR / obs-text
* @see https://github.com/nodejs/node/blob/8cf5ae07e9e80747c19e0fc04fad48423707f62c/lib/_http_common.js#L233
*/
var isInvalidHeaderChar = function isInvalidHeaderChar(val) {
return HEADER_CHAR_REGEX.test(val);
};
// This code is based on Node.js' validateHeader() function from _http_outgoing.js module

@@ -53,3 +71,3 @@ // (see https://github.com/nodejs/node/blob/189d29f39e6de9ccf10682bfd1341819b4a2291f/lib/_http_outgoing.js#L485)

// NOTE: These are internal Node.js functions, they might stop working in the future!
return typeof name !== 'string' || !name || !(0, _http_common._checkIsHttpToken)(name) || value === undefined || (0, _http_common._checkInvalidHeaderChar)(value);
return typeof name !== 'string' || !name || !isHttpToken(name) || value === undefined || isInvalidHeaderChar(value);
};

@@ -56,0 +74,0 @@

{
"name": "proxy-chain",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication, upstream proxy chaining, and protocol tunneling.",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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