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
This commit is contained in:
Johan Nordberg 2011-09-17 14:36:10 +02:00
parent bdf48bea36
commit 5ba25aa345

View File

@ -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) {