Skip to content

Commit

Permalink
Copy options before adding callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
nrn committed Feb 6, 2013
1 parent 28e8be5 commit e4d1e25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ function Request (options) {
}
}
}
options = copy(options)

this.init(options)
}
Expand Down Expand Up @@ -1095,6 +1094,8 @@ function request (uri, options, callback) {
options = uri
}

options = copy(options)

if (callback) options.callback = callback
var r = new Request(options)
return r
Expand Down
3 changes: 2 additions & 1 deletion tests/test-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})
Expand Down

0 comments on commit e4d1e25

Please sign in to comment.