http-proxy
Advanced tools
Comparing version 1.7.1 to 1.7.2
@@ -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, { |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
36534
691
0
2
+ Addedrequires-port@0.x.x
+ Addedeventemitter3@0.1.6(transitive)
+ Addedrequires-port@0.0.1(transitive)
- Removedeventemitter3@5.0.1(transitive)
Updatedeventemitter3@0.x.x