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

http-proxy

Package Overview
Dependencies
Maintainers
4
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.7.1 to 1.7.2

24

lib/http-proxy/common.js

@@ -1,4 +0,5 @@

var common = exports,
url = require('url'),
extend = require('util')._extend;
var common = exports,
url = require('url'),
extend = require('util')._extend,
required = require('requires-port');

@@ -77,5 +78,7 @@ var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;

if (options.changeOrigin) {
outgoing.headers.host = outgoing.host;
outgoing.headers.host =
required(outgoing.port, options[forward || 'target'].protocol) && !hasPort(outgoing.host)
? outgoing.host + ':' + outgoing.port
: outgoing.host;
}
return outgoing;

@@ -165,1 +168,12 @@ };

};
/**
* Check the host and see if it potentially has a port in it (keep it simple)
*
* @returns {Boolean} Whether we have one or not
*
* @api private
*/
function hasPort(host) {
return !!~host.indexOf(':');
};
{
"name" : "http-proxy",
"version" : "1.7.1",
"version" : "1.7.2",

@@ -20,3 +20,4 @@ "repository" : {

"dependencies" : {
"eventemitter3" : "*"
"eventemitter3" : "0.x.x",
"requires-port" : "0.x.x"
},

@@ -30,3 +31,3 @@ "devDependencies": {

"blanket" : "*",
"ws" : "*",
"ws" : "~0.5.0",
"socket.io" : "*",

@@ -33,0 +34,0 @@ "socket.io-client" : "*",

@@ -172,7 +172,7 @@ <p align="center">

//
// Create your server that make an operation that take a while
// and then proxy de request
// Create your server that makes an operation that waits a while
// and then proxies the request
//
http.createServer(function (req, res) {
// This simulate an operation that take 500ms in execute
// This simulates an operation that takes 500ms to execute
setTimeout(function () {

@@ -179,0 +179,0 @@ proxy.web(req, res, {

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