-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: check callback type of imcoming timeout #3618
Conversation
cc @nodejs/http |
👎 , protection already exists in |
@dougwilson Oho I see. Well then should we have this check here https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js#L93-L97 |
Unsure. Was added in PR #3090 , which can help us decide. |
Dupe of #3539 |
Kind of a dupe, anyway. That other PR covers other cases. |
@@ -63,8 +63,11 @@ exports.IncomingMessage = IncomingMessage; | |||
|
|||
|
|||
IncomingMessage.prototype.setTimeout = function(msecs, callback) { | |||
if (callback) | |||
if (callback) { | |||
if (typeof callback != 'function') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be strict check IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferred, yes. Although, typeof
only ever returns strings.
Replacement landed in 8625a38 |
No description provided.