Update to use the new parseUri()
authorUrban Hafner <urban@bettong.net>
Sun, 21 Jun 2009 14:28:58 +0000 (16:28 +0200)
committerUrban Hafner <urban@bettong.net>
Sun, 21 Jun 2009 14:28:58 +0000 (16:28 +0200)
src/http.js

index bef88bc..1bb126e 100644 (file)
@@ -522,9 +522,7 @@ node.http.Client = function (port, host) {
 
 node.http.cat = function(url, encoding, callback) {
   var uri = node.http.parseUri(url)
-  uri.port = uri.port == "" ? 80 : Number(uri.port)
-  uri.path = uri.path == "" ? "/" : uri.path
-  var req = new node.http.Client(uri.port, uri.host).get(uri.path)
+  var req = new node.http.Client(uri.port || 80, uri.host).get(uri.path || "/")
   req.finish(function(res) {
     var status = res.statusCode;
     res.setBodyEncoding(encoding)