diff options
Diffstat (limited to 'lib/http.js')
-rw-r--r-- | lib/http.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/http.js b/lib/http.js index 128bb0d2a4..db87b589b5 100644 --- a/lib/http.js +++ b/lib/http.js @@ -49,11 +49,13 @@ var client = require('_http_client'); var ClientRequest = exports.ClientRequest = client.ClientRequest; exports.request = function(options, cb) { - return globalAgent.request(options, cb); + return new ClientRequest(options, cb); }; exports.get = function(options, cb) { - return globalAgent.get(options, cb); + var req = exports.request(options, cb); + req.end(); + return req; }; exports._connectionListener = server._connectionListener; |