Skip to content

Commit

Permalink
Warn about bogus timeout options (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski authored and focusaurus committed Feb 22, 2017
1 parent 0f4ec4b commit 52bd175
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/request-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,17 @@ RequestBase.prototype.timeout = function timeout(options){
return this;
}

if ('undefined' !== typeof options.deadline) {
this._timeout = options.deadline;
}
if ('undefined' !== typeof options.response) {
this._responseTimeout = options.response;
for(var option in options) {
switch(option) {
case 'deadline':
this._timeout = options.deadline;
break;
case 'response':
this._responseTimeout = options.response;
break;
default:
console.warn("Unknown timeout option", option);
}
}
return this;
};
Expand Down

0 comments on commit 52bd175

Please sign in to comment.