axios 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of axios might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- // Axios v1.2.1 Copyright (c) 2022 Matt Zabriskie and contributors
1
+ // Axios v1.2.2 Copyright (c) 2022 Matt Zabriskie and contributors
2
2
  'use strict';
3
3
 
4
4
  const FormData$1 = require('form-data');
@@ -303,7 +303,11 @@ function findKey(obj, key) {
303
303
  return null;
304
304
  }
305
305
 
306
- const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self;
306
+ const _global = (() => {
307
+ /*eslint no-undef:0*/
308
+ if (typeof globalThis !== "undefined") return globalThis;
309
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
310
+ })();
307
311
 
308
312
  const isContextDefined = (context) => !isUndefined(context) && context !== _global;
309
313
 
@@ -1907,7 +1911,7 @@ function buildFullPath(baseURL, requestedURL) {
1907
1911
  return requestedURL;
1908
1912
  }
1909
1913
 
1910
- const VERSION = "1.2.1";
1914
+ const VERSION = "1.2.2";
1911
1915
 
1912
1916
  function parseProtocol(url) {
1913
1917
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -2234,6 +2238,11 @@ const zlibOptions = {
2234
2238
  finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
2235
2239
  };
2236
2240
 
2241
+ const brotliOptions = {
2242
+ flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
2243
+ finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
2244
+ };
2245
+
2237
2246
  const isBrotliSupported = utils.isFunction(zlib__default["default"].createBrotliDecompress);
2238
2247
 
2239
2248
  const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"];
@@ -2624,7 +2633,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
2624
2633
  switch (res.headers['content-encoding']) {
2625
2634
  /*eslint default-case:0*/
2626
2635
  case 'gzip':
2636
+ case 'x-gzip':
2627
2637
  case 'compress':
2638
+ case 'x-compress':
2628
2639
  case 'deflate':
2629
2640
  // add the unzipper to the body stream processing pipeline
2630
2641
  streams.push(zlib__default["default"].createUnzip(zlibOptions));
@@ -2634,7 +2645,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
2634
2645
  break;
2635
2646
  case 'br':
2636
2647
  if (isBrotliSupported) {
2637
- streams.push(zlib__default["default"].createBrotliDecompress(zlibOptions));
2648
+ streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
2638
2649
  delete res.headers['content-encoding'];
2639
2650
  }
2640
2651
  }
@@ -3809,6 +3820,78 @@ function isAxiosError(payload) {
3809
3820
  return utils.isObject(payload) && (payload.isAxiosError === true);
3810
3821
  }
3811
3822
 
3823
+ const HttpStatusCode = {
3824
+ Continue: 100,
3825
+ SwitchingProtocols: 101,
3826
+ Processing: 102,
3827
+ EarlyHints: 103,
3828
+ Ok: 200,
3829
+ Created: 201,
3830
+ Accepted: 202,
3831
+ NonAuthoritativeInformation: 203,
3832
+ NoContent: 204,
3833
+ ResetContent: 205,
3834
+ PartialContent: 206,
3835
+ MultiStatus: 207,
3836
+ AlreadyReported: 208,
3837
+ ImUsed: 226,
3838
+ MultipleChoices: 300,
3839
+ MovedPermanently: 301,
3840
+ Found: 302,
3841
+ SeeOther: 303,
3842
+ NotModified: 304,
3843
+ UseProxy: 305,
3844
+ Unused: 306,
3845
+ TemporaryRedirect: 307,
3846
+ PermanentRedirect: 308,
3847
+ BadRequest: 400,
3848
+ Unauthorized: 401,
3849
+ PaymentRequired: 402,
3850
+ Forbidden: 403,
3851
+ NotFound: 404,
3852
+ MethodNotAllowed: 405,
3853
+ NotAcceptable: 406,
3854
+ ProxyAuthenticationRequired: 407,
3855
+ RequestTimeout: 408,
3856
+ Conflict: 409,
3857
+ Gone: 410,
3858
+ LengthRequired: 411,
3859
+ PreconditionFailed: 412,
3860
+ PayloadTooLarge: 413,
3861
+ UriTooLong: 414,
3862
+ UnsupportedMediaType: 415,
3863
+ RangeNotSatisfiable: 416,
3864
+ ExpectationFailed: 417,
3865
+ ImATeapot: 418,
3866
+ MisdirectedRequest: 421,
3867
+ UnprocessableEntity: 422,
3868
+ Locked: 423,
3869
+ FailedDependency: 424,
3870
+ TooEarly: 425,
3871
+ UpgradeRequired: 426,
3872
+ PreconditionRequired: 428,
3873
+ TooManyRequests: 429,
3874
+ RequestHeaderFieldsTooLarge: 431,
3875
+ UnavailableForLegalReasons: 451,
3876
+ InternalServerError: 500,
3877
+ NotImplemented: 501,
3878
+ BadGateway: 502,
3879
+ ServiceUnavailable: 503,
3880
+ GatewayTimeout: 504,
3881
+ HttpVersionNotSupported: 505,
3882
+ VariantAlsoNegotiates: 506,
3883
+ InsufficientStorage: 507,
3884
+ LoopDetected: 508,
3885
+ NotExtended: 510,
3886
+ NetworkAuthenticationRequired: 511,
3887
+ };
3888
+
3889
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
3890
+ HttpStatusCode[value] = key;
3891
+ });
3892
+
3893
+ const HttpStatusCode$1 = HttpStatusCode;
3894
+
3812
3895
  /**
3813
3896
  * Create an instance of Axios
3814
3897
  *
@@ -3870,6 +3953,8 @@ axios.AxiosHeaders = AxiosHeaders$1;
3870
3953
 
3871
3954
  axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
3872
3955
 
3956
+ axios.HttpStatusCode = HttpStatusCode$1;
3957
+
3873
3958
  axios.default = axios;
3874
3959
 
3875
3960
  module.exports = axios;