`node v0.9.x` compatibility #399

Closed
wants to merge 5 commits into
from
View
@@ -108,7 +108,6 @@ function Request (options) {
}
}
}
- options = copy(options)
this.init(options)
}
@@ -572,6 +571,8 @@ Request.prototype.start = function () {
delete reqOptions.auth
self.req = self.httpModule.request(reqOptions, function (response) {
+ response.resume();
+
if (response.connection.listeners('error').indexOf(self._parserErrorHandler) === -1) {
response.connection.once('error', self._parserErrorHandler)
}
@@ -1140,6 +1141,8 @@ function request (uri, options, callback) {
options = uri
}
+ options = copy(options)
@kenperkins

kenperkins Apr 11, 2013

Contributor

What's the reason to move options copy down?

+
if (callback) options.callback = callback
var r = new Request(options)
return r
View
@@ -82,7 +82,8 @@ s.listen(s.port, function () {
}
counter = counter - 1;
if (counter === 0) {
- console.log(Object.keys(tests).length+" tests passed.")
+ assert.notEqual(typeof test.callback, 'function')
+ console.log(1 + Object.keys(tests).length+" tests passed.")
s.close()
}
})