http-proxy
Advanced tools
Comparing version 0.8.5 to 0.8.6
@@ -259,2 +259,27 @@ /* | ||
// | ||
// When the `reverseProxy` `response` ends, end the | ||
// corresponding outgoing `res` unless we have entered | ||
// an error state. In which case, assume `res.end()` has | ||
// already been called and the 'error' event listener | ||
// removed. | ||
// | ||
var ended = false; | ||
response.on('close', function () { | ||
if (!ended) { response.emit('end') } | ||
}); | ||
response.on('end', function () { | ||
ended = true; | ||
if (!errState) { | ||
reverseProxy.removeListener('error', proxyError); | ||
try { res.end() } | ||
catch (ex) { console.error("res.end error: %s", ex.message) } | ||
// Emit the `end` event now that we have completed proxying | ||
self.emit('end', req, res); | ||
} | ||
}); | ||
// Set the headers of the client response | ||
@@ -287,27 +312,2 @@ res.writeHead(response.statusCode, response.headers); | ||
res.on('drain', ondrain); | ||
// | ||
// When the `reverseProxy` `response` ends, end the | ||
// corresponding outgoing `res` unless we have entered | ||
// an error state. In which case, assume `res.end()` has | ||
// already been called and the 'error' event listener | ||
// removed. | ||
// | ||
var ended = false; | ||
response.on('close', function () { | ||
if (!ended) { response.emit('end') } | ||
}); | ||
response.on('end', function () { | ||
ended = true; | ||
if (!errState) { | ||
reverseProxy.removeListener('error', proxyError); | ||
try { res.end() } | ||
catch (ex) { console.error("res.end error: %s", ex.message) } | ||
// Emit the `end` event now that we have completed proxying | ||
self.emit('end', req, res); | ||
} | ||
}); | ||
}); | ||
@@ -319,2 +319,5 @@ | ||
reverseProxy.once('error', proxyError); | ||
reverseProxy.once('socket', function (socket) { | ||
socket.once('error', proxyError); | ||
}); | ||
@@ -730,2 +733,5 @@ // | ||
reverseProxy.on('error', proxyError); | ||
reverseProxy.once('socket', function (socket) { | ||
socket.once('error', proxyError); | ||
}); | ||
@@ -732,0 +738,0 @@ try { |
{ | ||
"name": "http-proxy", | ||
"version": "0.8.5", | ||
"version": "0.8.6", | ||
"description": "A full-featured http reverse proxy for node.js", | ||
@@ -28,5 +28,5 @@ "author": "Nodejitsu Inc. <info@nodejitsu.com>", | ||
"async": "0.1.x", | ||
"socket.io": "0.9.6", | ||
"socket.io-client": "0.9.6", | ||
"ws": "0.4.21" | ||
"socket.io": "0.9.11", | ||
"socket.io-client": "0.9.11", | ||
"ws": "0.4.23" | ||
}, | ||
@@ -33,0 +33,0 @@ "main": "./lib/node-http-proxy", |
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
1066951
281
22734
36
66