diff --git a/lib/request-base.js b/lib/request-base.js index ec5a03ace..c1bafab01 100644 --- a/lib/request-base.js +++ b/lib/request-base.js @@ -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; };