mirror of https://github.com/nodejs/node.git
Update to use the new parseUri()
parent
6550e8cfa0
commit
c192a1b5df
|
@ -522,9 +522,7 @@ node.http.Client = function (port, host) {
|
||||||
|
|
||||||
node.http.cat = function(url, encoding, callback) {
|
node.http.cat = function(url, encoding, callback) {
|
||||||
var uri = node.http.parseUri(url)
|
var uri = node.http.parseUri(url)
|
||||||
uri.port = uri.port == "" ? 80 : Number(uri.port)
|
var req = new node.http.Client(uri.port || 80, uri.host).get(uri.path || "/")
|
||||||
uri.path = uri.path == "" ? "/" : uri.path
|
|
||||||
var req = new node.http.Client(uri.port, uri.host).get(uri.path)
|
|
||||||
req.finish(function(res) {
|
req.finish(function(res) {
|
||||||
var status = res.statusCode;
|
var status = res.statusCode;
|
||||||
res.setBodyEncoding(encoding)
|
res.setBodyEncoding(encoding)
|
||||||
|
|
Loading…
Reference in New Issue