Skip to content

Commit 99f7572

Browse files
author
Alexander
committed
Fix for #591
Fix for proxy crash if `HOST` header is not defined bug #591.
1 parent 1067054 commit 99f7572

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/http-proxy/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ common.setupSocket = function(socket) {
7575
};
7676

7777
common.getPort = function(req) {
78-
var res = req.headers.host.match(/:(\d+)/);
78+
var res = req.headers.host ? req.headers.host.match(/:(\d+)/) : "";
7979
return res ?
8080
res[1] :
8181
req.connection.pair ? '443' : '80' ;

0 commit comments

Comments
 (0)