Loading lib/rp.js +8 −16 Original line number Diff line number Diff line Loading @@ -51,18 +51,17 @@ request.Request.prototype.init = function (options) { var self = this; self._rp_promise = new Bluebird(function (resolve, reject) { // Init may be called again - currently in case of redirects if (_.isPlainObject(options) && self._callback === undefined && self._rp_promise === undefined) { self._rp_promise = new Bluebird(function (resolve, reject) { self._rp_resolve = resolve; self._rp_reject = reject; }); self._rp_callbackOrig = self.callback; self.callback = ownCallback; if (_.isPlainObject(options)) { if (_.isString(options.method)) { options.method = options.method.toUpperCase(); } Loading @@ -71,13 +70,6 @@ request.Request.prototype.init = function (options) { self._rp_options.simple = options.simple === false ? false : true; self._rp_options.resolveWithFullResponse = options.resolveWithFullResponse === true ? true : false; } else { self._rp_options = { simple: true, resolveWithFullResponse: false }; } return originalInit.apply(self, arguments); Loading Loading
lib/rp.js +8 −16 Original line number Diff line number Diff line Loading @@ -51,18 +51,17 @@ request.Request.prototype.init = function (options) { var self = this; self._rp_promise = new Bluebird(function (resolve, reject) { // Init may be called again - currently in case of redirects if (_.isPlainObject(options) && self._callback === undefined && self._rp_promise === undefined) { self._rp_promise = new Bluebird(function (resolve, reject) { self._rp_resolve = resolve; self._rp_reject = reject; }); self._rp_callbackOrig = self.callback; self.callback = ownCallback; if (_.isPlainObject(options)) { if (_.isString(options.method)) { options.method = options.method.toUpperCase(); } Loading @@ -71,13 +70,6 @@ request.Request.prototype.init = function (options) { self._rp_options.simple = options.simple === false ? false : true; self._rp_options.resolveWithFullResponse = options.resolveWithFullResponse === true ? true : false; } else { self._rp_options = { simple: true, resolveWithFullResponse: false }; } return originalInit.apply(self, arguments); Loading