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

http-proxy

Package Overview
Dependencies
Maintainers
5
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-proxy - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

cov/coverage.html

4

lib/http-proxy.js

@@ -7,5 +7,5 @@ var http = require('http'),

/**
* Export the the proxy "Server" as the main export
* Export the proxy "Server" as the main export.
*/
module.exports = httpProxy.Server;
module.exports = httpProxy.Server;

@@ -12,0 +12,0 @@ /**

@@ -74,5 +74,3 @@ var common = exports,

outgoing.path = targetPath
? targetPath + '/' + outgoingPath
: outgoingPath;
outgoing.path = common.urlJoin(targetPath, outgoingPath);

@@ -108,7 +106,34 @@ return outgoing;

/**
* Get the port number from the host. Or guess it based on the connection type.
*
* @param {Request} req Incoming HTTP request.
*
* @return {String} The port number.
*
* @api private
*/
common.getPort = function(req) {
var res = req.headers.host ? req.headers.host.match(/:(\d+)/) : "";
var res = req.headers.host ? req.headers.host.match(/:(\d+)/) : '';
return res ?
res[1] :
req.connection.pair ? '443' : '80' ;
}
req.connection.pair ? '443' : '80';
};
/**
* OS-agnostic join (doesn't break on URLs like path.join does on Windows)>
*
* @return {String} The generated path.
*
* @api private
*/
common.urlJoin = function() {
var args = Array.prototype.slice.call(arguments);
// Join all strings, but remove empty strings so we don't get extra slashes from
// joining e.g. ['', 'am']
return args.filter(function filter(a) {
return !!a;
}).join('/').replace(/\/+/g, '/');
};
{
"name" : "http-proxy",
"version" : "1.4.2",
"version" : "1.4.3",

@@ -5,0 +5,0 @@ "repository" : {

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