1 | ;
|
2 |
|
3 | const semver = require('semver');
|
4 |
|
5 | /**
|
6 | * Module of mixed-in functions shared between node and client code
|
7 | */
|
8 | const _require = require('./utils'),
|
9 | isObject = _require.isObject,
|
10 | hasOwn = _require.hasOwn;
|
11 |
|
12 | /**
|
13 | * Expose `RequestBase`.
|
14 | */
|
15 |
|
16 | module.exports = RequestBase;
|
17 |
|
18 | /**
|
19 | * Initialize a new `RequestBase`.
|
20 | *
|
21 | * @api public
|
22 | */
|
23 |
|
24 | function RequestBase() {}
|
25 |
|
26 | /**
|
27 | * Clear previous timeout.
|
28 | *
|
29 | * @return {Request} for chaining
|
30 | * @api public
|
31 | */
|
32 |
|
33 | RequestBase.prototype.clearTimeout = function () {
|
34 | clearTimeout(this._timer);
|
35 | clearTimeout(this._responseTimeoutTimer);
|
36 | clearTimeout(this._uploadTimeoutTimer);
|
37 | delete this._timer;
|
38 | delete this._responseTimeoutTimer;
|
39 | delete this._uploadTimeoutTimer;
|
40 | return this;
|
41 | };
|
42 |
|
43 | /**
|
44 | * Override default response body parser
|
45 | *
|
46 | * This function will be called to convert incoming data into request.body
|
47 | *
|
48 | * @param {Function}
|
49 | * @api public
|
50 | */
|
51 |
|
52 | RequestBase.prototype.parse = function (fn) {
|
53 | this._parser = fn;
|
54 | return this;
|
55 | };
|
56 |
|
57 | /**
|
58 | * Set format of binary response body.
|
59 | * In browser valid formats are 'blob' and 'arraybuffer',
|
60 | * which return Blob and ArrayBuffer, respectively.
|
61 | *
|
62 | * In Node all values result in Buffer.
|
63 | *
|
64 | * Examples:
|
65 | *
|
66 | * req.get('/')
|
67 | * .responseType('blob')
|
68 | * .end(callback);
|
69 | *
|
70 | * @param {String} val
|
71 | * @return {Request} for chaining
|
72 | * @api public
|
73 | */
|
74 |
|
75 | RequestBase.prototype.responseType = function (value) {
|
76 | this._responseType = value;
|
77 | return this;
|
78 | };
|
79 |
|
80 | /**
|
81 | * Override default request body serializer
|
82 | *
|
83 | * This function will be called to convert data set via .send or .attach into payload to send
|
84 | *
|
85 | * @param {Function}
|
86 | * @api public
|
87 | */
|
88 |
|
89 | RequestBase.prototype.serialize = function (fn) {
|
90 | this._serializer = fn;
|
91 | return this;
|
92 | };
|
93 |
|
94 | /**
|
95 | * Set timeouts.
|
96 | *
|
97 | * - response timeout is time between sending request and receiving the first byte of the response. Includes DNS and connection time.
|
98 | * - deadline is the time from start of the request to receiving response body in full. If the deadline is too short large files may not load at all on slow connections.
|
99 | * - upload is the time since last bit of data was sent or received. This timeout works only if deadline timeout is off
|
100 | *
|
101 | * Value of 0 or false means no timeout.
|
102 | *
|
103 | * @param {Number|Object} ms or {response, deadline}
|
104 | * @return {Request} for chaining
|
105 | * @api public
|
106 | */
|
107 |
|
108 | RequestBase.prototype.timeout = function (options) {
|
109 | if (!options || typeof options !== 'object') {
|
110 | this._timeout = options;
|
111 | this._responseTimeout = 0;
|
112 | this._uploadTimeout = 0;
|
113 | return this;
|
114 | }
|
115 | for (const option in options) {
|
116 | if (hasOwn(options, option)) {
|
117 | switch (option) {
|
118 | case 'deadline':
|
119 | this._timeout = options.deadline;
|
120 | break;
|
121 | case 'response':
|
122 | this._responseTimeout = options.response;
|
123 | break;
|
124 | case 'upload':
|
125 | this._uploadTimeout = options.upload;
|
126 | break;
|
127 | default:
|
128 | console.warn('Unknown timeout option', option);
|
129 | }
|
130 | }
|
131 | }
|
132 | return this;
|
133 | };
|
134 |
|
135 | /**
|
136 | * Set number of retry attempts on error.
|
137 | *
|
138 | * Failed requests will be retried 'count' times if timeout or err.code >= 500.
|
139 | *
|
140 | * @param {Number} count
|
141 | * @param {Function} [fn]
|
142 | * @return {Request} for chaining
|
143 | * @api public
|
144 | */
|
145 |
|
146 | RequestBase.prototype.retry = function (count, fn) {
|
147 | // Default to 1 if no count passed or true
|
148 | if (arguments.length === 0 || count === true) count = 1;
|
149 | if (count <= 0) count = 0;
|
150 | this._maxRetries = count;
|
151 | this._retries = 0;
|
152 | this._retryCallback = fn;
|
153 | return this;
|
154 | };
|
155 |
|
156 | //
|
157 | // NOTE: we do not include ESOCKETTIMEDOUT because that is from `request` package
|
158 | // <https://github.com/sindresorhus/got/pull/537>
|
159 | //
|
160 | // NOTE: we do not include EADDRINFO because it was removed from libuv in 2014
|
161 | // <https://github.com/libuv/libuv/commit/02e1ebd40b807be5af46343ea873331b2ee4e9c1>
|
162 | // <https://github.com/request/request/search?q=ESOCKETTIMEDOUT&unscoped_q=ESOCKETTIMEDOUT>
|
163 | //
|
164 | //
|
165 | // TODO: expose these as configurable defaults
|
166 | //
|
167 | const ERROR_CODES = new Set(['ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN']);
|
168 | const STATUS_CODES = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524]);
|
169 |
|
170 | // TODO: we would need to make this easily configurable before adding it in (e.g. some might want to add POST)
|
171 | // const METHODS = new Set(['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE']);
|
172 |
|
173 | /**
|
174 | * Determine if a request should be retried.
|
175 | * (Inspired by https://github.com/sindresorhus/got#retry)
|
176 | *
|
177 | * @param {Error} err an error
|
178 | * @param {Response} [res] response
|
179 | * @returns {Boolean} if segment should be retried
|
180 | */
|
181 | RequestBase.prototype._shouldRetry = function (error, res) {
|
182 | if (!this._maxRetries || this._retries++ >= this._maxRetries) {
|
183 | return false;
|
184 | }
|
185 | if (this._retryCallback) {
|
186 | try {
|
187 | const override = this._retryCallback(error, res);
|
188 | if (override === true) return true;
|
189 | if (override === false) return false;
|
190 | // undefined falls back to defaults
|
191 | } catch (err) {
|
192 | console.error(err);
|
193 | }
|
194 | }
|
195 |
|
196 | // TODO: we would need to make this easily configurable before adding it in (e.g. some might want to add POST)
|
197 | /*
|
198 | if (
|
199 | this.req &&
|
200 | this.req.method &&
|
201 | !METHODS.has(this.req.method.toUpperCase())
|
202 | )
|
203 | return false;
|
204 | */
|
205 | if (res && res.status && STATUS_CODES.has(res.status)) return true;
|
206 | if (error) {
|
207 | if (error.code && ERROR_CODES.has(error.code)) return true;
|
208 | // Superagent timeout
|
209 | if (error.timeout && error.code === 'ECONNABORTED') return true;
|
210 | if (error.crossDomain) return true;
|
211 | }
|
212 | return false;
|
213 | };
|
214 |
|
215 | /**
|
216 | * Retry request
|
217 | *
|
218 | * @return {Request} for chaining
|
219 | * @api private
|
220 | */
|
221 |
|
222 | RequestBase.prototype._retry = function () {
|
223 | this.clearTimeout();
|
224 |
|
225 | // node
|
226 | if (this.req) {
|
227 | this.req = null;
|
228 | this.req = this.request();
|
229 | }
|
230 | this._aborted = false;
|
231 | this.timedout = false;
|
232 | this.timedoutError = null;
|
233 | return this._end();
|
234 | };
|
235 |
|
236 | /**
|
237 | * Promise support
|
238 | *
|
239 | * @param {Function} resolve
|
240 | * @param {Function} [reject]
|
241 | * @return {Request}
|
242 | */
|
243 |
|
244 | RequestBase.prototype.then = function (resolve, reject) {
|
245 | if (!this._fullfilledPromise) {
|
246 | const self = this;
|
247 | if (this._endCalled) {
|
248 | console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises');
|
249 | }
|
250 | this._fullfilledPromise = new Promise((resolve, reject) => {
|
251 | self.on('abort', () => {
|
252 | if (this._maxRetries && this._maxRetries > this._retries) {
|
253 | return;
|
254 | }
|
255 | if (this.timedout && this.timedoutError) {
|
256 | reject(this.timedoutError);
|
257 | return;
|
258 | }
|
259 | const error = new Error('Aborted');
|
260 | error.code = 'ABORTED';
|
261 | error.status = this.status;
|
262 | error.method = this.method;
|
263 | error.url = this.url;
|
264 | reject(error);
|
265 | });
|
266 | self.end((error, res) => {
|
267 | if (error) reject(error);else resolve(res);
|
268 | });
|
269 | });
|
270 | }
|
271 | return this._fullfilledPromise.then(resolve, reject);
|
272 | };
|
273 | RequestBase.prototype.catch = function (callback) {
|
274 | return this.then(undefined, callback);
|
275 | };
|
276 |
|
277 | /**
|
278 | * Allow for extension
|
279 | */
|
280 |
|
281 | RequestBase.prototype.use = function (fn) {
|
282 | fn(this);
|
283 | return this;
|
284 | };
|
285 | RequestBase.prototype.ok = function (callback) {
|
286 | if (typeof callback !== 'function') throw new Error('Callback required');
|
287 | this._okCallback = callback;
|
288 | return this;
|
289 | };
|
290 | RequestBase.prototype._isResponseOK = function (res) {
|
291 | if (!res) {
|
292 | return false;
|
293 | }
|
294 | if (this._okCallback) {
|
295 | return this._okCallback(res);
|
296 | }
|
297 | return res.status >= 200 && res.status < 300;
|
298 | };
|
299 |
|
300 | /**
|
301 | * Get request header `field`.
|
302 | * Case-insensitive.
|
303 | *
|
304 | * @param {String} field
|
305 | * @return {String}
|
306 | * @api public
|
307 | */
|
308 |
|
309 | RequestBase.prototype.get = function (field) {
|
310 | return this._header[field.toLowerCase()];
|
311 | };
|
312 |
|
313 | /**
|
314 | * Get case-insensitive header `field` value.
|
315 | * This is a deprecated internal API. Use `.get(field)` instead.
|
316 | *
|
317 | * (getHeader is no longer used internally by the superagent code base)
|
318 | *
|
319 | * @param {String} field
|
320 | * @return {String}
|
321 | * @api private
|
322 | * @deprecated
|
323 | */
|
324 |
|
325 | RequestBase.prototype.getHeader = RequestBase.prototype.get;
|
326 |
|
327 | /**
|
328 | * Set header `field` to `val`, or multiple fields with one object.
|
329 | * Case-insensitive.
|
330 | *
|
331 | * Examples:
|
332 | *
|
333 | * req.get('/')
|
334 | * .set('Accept', 'application/json')
|
335 | * .set('X-API-Key', 'foobar')
|
336 | * .end(callback);
|
337 | *
|
338 | * req.get('/')
|
339 | * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })
|
340 | * .end(callback);
|
341 | *
|
342 | * @param {String|Object} field
|
343 | * @param {String} val
|
344 | * @return {Request} for chaining
|
345 | * @api public
|
346 | */
|
347 |
|
348 | RequestBase.prototype.set = function (field, value) {
|
349 | if (isObject(field)) {
|
350 | for (const key in field) {
|
351 | if (hasOwn(field, key)) this.set(key, field[key]);
|
352 | }
|
353 | return this;
|
354 | }
|
355 | this._header[field.toLowerCase()] = value;
|
356 | this.header[field] = value;
|
357 | return this;
|
358 | };
|
359 |
|
360 | /**
|
361 | * Remove header `field`.
|
362 | * Case-insensitive.
|
363 | *
|
364 | * Example:
|
365 | *
|
366 | * req.get('/')
|
367 | * .unset('User-Agent')
|
368 | * .end(callback);
|
369 | *
|
370 | * @param {String} field field name
|
371 | */
|
372 | RequestBase.prototype.unset = function (field) {
|
373 | delete this._header[field.toLowerCase()];
|
374 | delete this.header[field];
|
375 | return this;
|
376 | };
|
377 |
|
378 | /**
|
379 | * Write the field `name` and `val`, or multiple fields with one object
|
380 | * for "multipart/form-data" request bodies.
|
381 | *
|
382 | * ``` js
|
383 | * request.post('/upload')
|
384 | * .field('foo', 'bar')
|
385 | * .end(callback);
|
386 | *
|
387 | * request.post('/upload')
|
388 | * .field({ foo: 'bar', baz: 'qux' })
|
389 | * .end(callback);
|
390 | * ```
|
391 | *
|
392 | * @param {String|Object} name name of field
|
393 | * @param {String|Blob|File|Buffer|fs.ReadStream} val value of field
|
394 | * @param {String} options extra options, e.g. 'blob'
|
395 | * @return {Request} for chaining
|
396 | * @api public
|
397 | */
|
398 | RequestBase.prototype.field = function (name, value, options) {
|
399 | // name should be either a string or an object.
|
400 | if (name === null || undefined === name) {
|
401 | throw new Error('.field(name, val) name can not be empty');
|
402 | }
|
403 | if (this._data) {
|
404 | throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");
|
405 | }
|
406 | if (isObject(name)) {
|
407 | for (const key in name) {
|
408 | if (hasOwn(name, key)) this.field(key, name[key]);
|
409 | }
|
410 | return this;
|
411 | }
|
412 | if (Array.isArray(value)) {
|
413 | for (const i in value) {
|
414 | if (hasOwn(value, i)) this.field(name, value[i]);
|
415 | }
|
416 | return this;
|
417 | }
|
418 |
|
419 | // val should be defined now
|
420 | if (value === null || undefined === value) {
|
421 | throw new Error('.field(name, val) val can not be empty');
|
422 | }
|
423 | if (typeof value === 'boolean') {
|
424 | value = String(value);
|
425 | }
|
426 |
|
427 | // fix https://github.com/ladjs/superagent/issues/1680
|
428 | if (options) this._getFormData().append(name, value, options);else this._getFormData().append(name, value);
|
429 | return this;
|
430 | };
|
431 |
|
432 | /**
|
433 | * Abort the request, and clear potential timeout.
|
434 | *
|
435 | * @return {Request} request
|
436 | * @api public
|
437 | */
|
438 | RequestBase.prototype.abort = function () {
|
439 | if (this._aborted) {
|
440 | return this;
|
441 | }
|
442 | this._aborted = true;
|
443 | if (this.xhr) this.xhr.abort(); // browser
|
444 | if (this.req) {
|
445 | // Node v13 has major differences in `abort()`
|
446 | // https://github.com/nodejs/node/blob/v12.x/lib/internal/streams/end-of-stream.js
|
447 | // https://github.com/nodejs/node/blob/v13.x/lib/internal/streams/end-of-stream.js
|
448 | // https://github.com/nodejs/node/blob/v14.x/lib/internal/streams/end-of-stream.js
|
449 | // (if you run a diff across these you will see the differences)
|
450 | //
|
451 | // References:
|
452 | // <https://github.com/nodejs/node/issues/31630>
|
453 | // <https://github.com/ladjs/superagent/pull/1084/commits/dc18679a7c5ccfc6046d882015e5126888973bc8>
|
454 | //
|
455 | // Thanks to @shadowgate15 and @niftylettuce
|
456 | if (semver.gte(process.version, 'v13.0.0') && semver.lt(process.version, 'v14.0.0')) {
|
457 | // Note that the reason this doesn't work is because in v13 as compared to v14
|
458 | // there is no `callback = nop` set in end-of-stream.js above
|
459 | throw new Error('Superagent does not work in v13 properly with abort() due to Node.js core changes');
|
460 | } else if (semver.gte(process.version, 'v14.0.0')) {
|
461 | // We have to manually set `destroyed` to `true` in order for this to work
|
462 | // (see core internals of end-of-stream.js above in v14 branch as compared to v12)
|
463 | this.req.destroyed = true;
|
464 | }
|
465 | this.req.abort(); // node
|
466 | }
|
467 |
|
468 | this.clearTimeout();
|
469 | this.emit('abort');
|
470 | return this;
|
471 | };
|
472 | RequestBase.prototype._auth = function (user, pass, options, base64Encoder) {
|
473 | switch (options.type) {
|
474 | case 'basic':
|
475 | this.set('Authorization', `Basic ${base64Encoder(`${user}:${pass}`)}`);
|
476 | break;
|
477 | case 'auto':
|
478 | this.username = user;
|
479 | this.password = pass;
|
480 | break;
|
481 | case 'bearer':
|
482 | // usage would be .auth(accessToken, { type: 'bearer' })
|
483 | this.set('Authorization', `Bearer ${user}`);
|
484 | break;
|
485 | default:
|
486 | break;
|
487 | }
|
488 | return this;
|
489 | };
|
490 |
|
491 | /**
|
492 | * Enable transmission of cookies with x-domain requests.
|
493 | *
|
494 | * Note that for this to work the origin must not be
|
495 | * using "Access-Control-Allow-Origin" with a wildcard,
|
496 | * and also must set "Access-Control-Allow-Credentials"
|
497 | * to "true".
|
498 | * @param {Boolean} [on=true] - Set 'withCredentials' state
|
499 | * @return {Request} for chaining
|
500 | * @api public
|
501 | */
|
502 |
|
503 | RequestBase.prototype.withCredentials = function (on) {
|
504 | // This is browser-only functionality. Node side is no-op.
|
505 | if (on === undefined) on = true;
|
506 | this._withCredentials = on;
|
507 | return this;
|
508 | };
|
509 |
|
510 | /**
|
511 | * Set the max redirects to `n`. Does nothing in browser XHR implementation.
|
512 | *
|
513 | * @param {Number} n
|
514 | * @return {Request} for chaining
|
515 | * @api public
|
516 | */
|
517 |
|
518 | RequestBase.prototype.redirects = function (n) {
|
519 | this._maxRedirects = n;
|
520 | return this;
|
521 | };
|
522 |
|
523 | /**
|
524 | * Maximum size of buffered response body, in bytes. Counts uncompressed size.
|
525 | * Default 200MB.
|
526 | *
|
527 | * @param {Number} n number of bytes
|
528 | * @return {Request} for chaining
|
529 | */
|
530 | RequestBase.prototype.maxResponseSize = function (n) {
|
531 | if (typeof n !== 'number') {
|
532 | throw new TypeError('Invalid argument');
|
533 | }
|
534 | this._maxResponseSize = n;
|
535 | return this;
|
536 | };
|
537 |
|
538 | /**
|
539 | * Convert to a plain javascript object (not JSON string) of scalar properties.
|
540 | * Note as this method is designed to return a useful non-this value,
|
541 | * it cannot be chained.
|
542 | *
|
543 | * @return {Object} describing method, url, and data of this request
|
544 | * @api public
|
545 | */
|
546 |
|
547 | RequestBase.prototype.toJSON = function () {
|
548 | return {
|
549 | method: this.method,
|
550 | url: this.url,
|
551 | data: this._data,
|
552 | headers: this._header
|
553 | };
|
554 | };
|
555 |
|
556 | /**
|
557 | * Send `data` as the request body, defaulting the `.type()` to "json" when
|
558 | * an object is given.
|
559 | *
|
560 | * Examples:
|
561 | *
|
562 | * // manual json
|
563 | * request.post('/user')
|
564 | * .type('json')
|
565 | * .send('{"name":"tj"}')
|
566 | * .end(callback)
|
567 | *
|
568 | * // auto json
|
569 | * request.post('/user')
|
570 | * .send({ name: 'tj' })
|
571 | * .end(callback)
|
572 | *
|
573 | * // manual x-www-form-urlencoded
|
574 | * request.post('/user')
|
575 | * .type('form')
|
576 | * .send('name=tj')
|
577 | * .end(callback)
|
578 | *
|
579 | * // auto x-www-form-urlencoded
|
580 | * request.post('/user')
|
581 | * .type('form')
|
582 | * .send({ name: 'tj' })
|
583 | * .end(callback)
|
584 | *
|
585 | * // defaults to x-www-form-urlencoded
|
586 | * request.post('/user')
|
587 | * .send('name=tobi')
|
588 | * .send('species=ferret')
|
589 | * .end(callback)
|
590 | *
|
591 | * @param {String|Object} data
|
592 | * @return {Request} for chaining
|
593 | * @api public
|
594 | */
|
595 |
|
596 | // eslint-disable-next-line complexity
|
597 | RequestBase.prototype.send = function (data) {
|
598 | const isObject_ = isObject(data);
|
599 | let type = this._header['content-type'];
|
600 | if (this._formData) {
|
601 | throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");
|
602 | }
|
603 | if (isObject_ && !this._data) {
|
604 | if (Array.isArray(data)) {
|
605 | this._data = [];
|
606 | } else if (!this._isHost(data)) {
|
607 | this._data = {};
|
608 | }
|
609 | } else if (data && this._data && this._isHost(this._data)) {
|
610 | throw new Error("Can't merge these send calls");
|
611 | }
|
612 |
|
613 | // merge
|
614 | if (isObject_ && isObject(this._data)) {
|
615 | for (const key in data) {
|
616 | if (hasOwn(data, key)) this._data[key] = data[key];
|
617 | }
|
618 | } else if (typeof data === 'string') {
|
619 | // default to x-www-form-urlencoded
|
620 | if (!type) this.type('form');
|
621 | type = this._header['content-type'];
|
622 | if (type) type = type.toLowerCase().trim();
|
623 | if (type === 'application/x-www-form-urlencoded') {
|
624 | this._data = this._data ? `${this._data}&${data}` : data;
|
625 | } else {
|
626 | this._data = (this._data || '') + data;
|
627 | }
|
628 | } else {
|
629 | this._data = data;
|
630 | }
|
631 | if (!isObject_ || this._isHost(data)) {
|
632 | return this;
|
633 | }
|
634 |
|
635 | // default to json
|
636 | if (!type) this.type('json');
|
637 | return this;
|
638 | };
|
639 |
|
640 | /**
|
641 | * Sort `querystring` by the sort function
|
642 | *
|
643 | *
|
644 | * Examples:
|
645 | *
|
646 | * // default order
|
647 | * request.get('/user')
|
648 | * .query('name=Nick')
|
649 | * .query('search=Manny')
|
650 | * .sortQuery()
|
651 | * .end(callback)
|
652 | *
|
653 | * // customized sort function
|
654 | * request.get('/user')
|
655 | * .query('name=Nick')
|
656 | * .query('search=Manny')
|
657 | * .sortQuery(function(a, b){
|
658 | * return a.length - b.length;
|
659 | * })
|
660 | * .end(callback)
|
661 | *
|
662 | *
|
663 | * @param {Function} sort
|
664 | * @return {Request} for chaining
|
665 | * @api public
|
666 | */
|
667 |
|
668 | RequestBase.prototype.sortQuery = function (sort) {
|
669 | // _sort default to true but otherwise can be a function or boolean
|
670 | this._sort = typeof sort === 'undefined' ? true : sort;
|
671 | return this;
|
672 | };
|
673 |
|
674 | /**
|
675 | * Compose querystring to append to req.url
|
676 | *
|
677 | * @api private
|
678 | */
|
679 | RequestBase.prototype._finalizeQueryString = function () {
|
680 | const query = this._query.join('&');
|
681 | if (query) {
|
682 | this.url += (this.url.includes('?') ? '&' : '?') + query;
|
683 | }
|
684 | this._query.length = 0; // Makes the call idempotent
|
685 |
|
686 | if (this._sort) {
|
687 | const index = this.url.indexOf('?');
|
688 | if (index >= 0) {
|
689 | const queryArray = this.url.slice(index + 1).split('&');
|
690 | if (typeof this._sort === 'function') {
|
691 | queryArray.sort(this._sort);
|
692 | } else {
|
693 | queryArray.sort();
|
694 | }
|
695 | this.url = this.url.slice(0, index) + '?' + queryArray.join('&');
|
696 | }
|
697 | }
|
698 | };
|
699 |
|
700 | // For backwards compat only
|
701 | RequestBase.prototype._appendQueryString = () => {
|
702 | console.warn('Unsupported');
|
703 | };
|
704 |
|
705 | /**
|
706 | * Invoke callback with timeout error.
|
707 | *
|
708 | * @api private
|
709 | */
|
710 |
|
711 | RequestBase.prototype._timeoutError = function (reason, timeout, errno) {
|
712 | if (this._aborted) {
|
713 | return;
|
714 | }
|
715 | const error = new Error(`${reason + timeout}ms exceeded`);
|
716 | error.timeout = timeout;
|
717 | error.code = 'ECONNABORTED';
|
718 | error.errno = errno;
|
719 | this.timedout = true;
|
720 | this.timedoutError = error;
|
721 | this.abort();
|
722 | this.callback(error);
|
723 | };
|
724 | RequestBase.prototype._setTimeouts = function () {
|
725 | const self = this;
|
726 |
|
727 | // deadline
|
728 | if (this._timeout && !this._timer) {
|
729 | this._timer = setTimeout(() => {
|
730 | self._timeoutError('Timeout of ', self._timeout, 'ETIME');
|
731 | }, this._timeout);
|
732 | }
|
733 |
|
734 | // response timeout
|
735 | if (this._responseTimeout && !this._responseTimeoutTimer) {
|
736 | this._responseTimeoutTimer = setTimeout(() => {
|
737 | self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT');
|
738 | }, this._responseTimeout);
|
739 | }
|
740 | };
|
741 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJzZW12ZXIiLCJyZXF1aXJlIiwiaXNPYmplY3QiLCJoYXNPd24iLCJtb2R1bGUiLCJleHBvcnRzIiwiUmVxdWVzdEJhc2UiLCJwcm90b3R5cGUiLCJjbGVhclRpbWVvdXQiLCJfdGltZXIiLCJfcmVzcG9uc2VUaW1lb3V0VGltZXIiLCJfdXBsb2FkVGltZW91dFRpbWVyIiwicGFyc2UiLCJmbiIs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