Skip to content

Commit

Permalink
http: add callback is function check
Browse files Browse the repository at this point in the history
We were checking that the callback existed, but not
checking that it was a function
  • Loading branch information
jasnell committed Oct 6, 2015
1 parent 6ad458b commit 3827ad5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ exports.OutgoingMessage = OutgoingMessage;


OutgoingMessage.prototype.setTimeout = function(msecs, callback) {
if (callback)
if (typeof callback === 'function')
this.on('timeout', callback);

if (!this.socket) {
Expand Down

0 comments on commit 3827ad5

Please sign in to comment.