Skip to content

Commit 5ba25aa

Browse files
committed
Make sure the target port is an integer
This fixes a bug that caused cli to fail when --target was specified with both hostname and port
1 parent bdf48be commit 5ba25aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/node-http-proxy

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if (typeof target === 'string') location = target.split(':');
6464
//
6565
var server;
6666
if (location) {
67-
var targetPort = location.length === 1 ? 80 : location[1];
67+
var targetPort = location.length === 1 ? 80 : parseInt(location[1]);
6868
server = httpProxy.createServer(targetPort, location[0], config);
6969
}
7070
else if (config.router) {

0 commit comments

Comments
 (0)