From 5ba25aa3451f131b6c6c8892848a4f236f5b859e Mon Sep 17 00:00:00 2001 From: Johan Nordberg Date: Sat, 17 Sep 2011 14:36:10 +0200 Subject: [PATCH] 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 --- bin/node-http-proxy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/node-http-proxy b/bin/node-http-proxy index 53139d26f..87de8bb5f 100755 --- a/bin/node-http-proxy +++ b/bin/node-http-proxy @@ -64,7 +64,7 @@ if (typeof target === 'string') location = target.split(':'); // var server; if (location) { - var targetPort = location.length === 1 ? 80 : location[1]; + var targetPort = location.length === 1 ? 80 : parseInt(location[1]); server = httpProxy.createServer(targetPort, location[0], config); } else if (config.router) {