Skip to content

Commit 0ba4fa8

Browse files
committed
Merge pull request #549 from mmoulton/caronte
Only emit response if a valid server is present
2 parents 2c8edc1 + 969a623 commit 0ba4fa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/http-proxy/passes/web-incoming.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ web_o = Object.keys(web_o).map(function(pass) {
117117
(options.buffer || req).pipe(proxyReq);
118118

119119
proxyReq.on('response', function(proxyRes) {
120-
server.emit('proxyRes', proxyRes);
120+
if(server) { server.emit('proxyRes', proxyRes); }
121121
for(var i=0; i < web_o.length; i++) {
122122
if(web_o[i](req, res, proxyRes)) { break; }
123123
}

0 commit comments

Comments
 (0)