Skip to content

Commit

Permalink
Merge pull request #549 from mmoulton/caronte
Browse files Browse the repository at this point in the history
Only emit response if a valid server is present
  • Loading branch information
yawnt committed Jan 14, 2014
2 parents 2c8edc1 + 969a623 commit 0ba4fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/http-proxy/passes/web-incoming.js
Expand Up @@ -117,7 +117,7 @@ web_o = Object.keys(web_o).map(function(pass) {
(options.buffer || req).pipe(proxyReq);

proxyReq.on('response', function(proxyRes) {
server.emit('proxyRes', proxyRes);
if(server) { server.emit('proxyRes', proxyRes); }
for(var i=0; i < web_o.length; i++) {
if(web_o[i](req, res, proxyRes)) { break; }
}
Expand Down

0 comments on commit 0ba4fa8

Please sign in to comment.