2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00

chore(release): v1.6.2 (#6082)

Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-11-14 22:35:24 +02:00
committed by GitHub
parent 8739acbd28
commit b3be365858
17 changed files with 209 additions and 202 deletions
+42 -47
View File
@@ -1,4 +1,4 @@
// Axios v1.6.1 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.6.2 Copyright (c) 2023 Matt Zabriskie and contributors
'use strict';
const FormData$1 = require('form-data');
@@ -2019,7 +2019,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL;
}
const VERSION = "1.6.1";
const VERSION = "1.6.2";
function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -3157,51 +3157,42 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
const cookies = platform.hasStandardBrowserEnv ?
// Standard browser envs support document.cookie
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
const cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
// Standard browser envs support document.cookie
{
write(name, value, expires, path, domain, secure) {
const cookie = [name + '=' + encodeURIComponent(value)];
if (utils$1.isNumber(expires)) {
cookie.push('expires=' + new Date(expires).toGMTString());
}
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
if (utils$1.isString(path)) {
cookie.push('path=' + path);
}
utils$1.isString(path) && cookie.push('path=' + path);
if (utils$1.isString(domain)) {
cookie.push('domain=' + domain);
}
utils$1.isString(domain) && cookie.push('domain=' + domain);
if (secure === true) {
cookie.push('secure');
}
secure === true && cookie.push('secure');
document.cookie = cookie.join('; ');
},
document.cookie = cookie.join('; ');
},
read: function read(name) {
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
read(name) {
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
remove: function remove(name) {
this.write(name, '', Date.now() - 86400000);
}
};
})() :
remove(name) {
this.write(name, '', Date.now() - 86400000);
}
}
// Non standard browser env (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return {
write: function write() {},
read: function read() { return null; },
remove: function remove() {}
};
})();
:
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {},
read() {
return null;
},
remove() {}
};
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
@@ -3213,7 +3204,7 @@ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
let originURL;
/**
* Parse a URL to discover it's components
* Parse a URL to discover its components
*
* @param {String} url The URL to be parsed
* @returns {Object}
@@ -3301,7 +3292,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
let requestData = config.data;
const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
const responseType = config.responseType;
let {responseType, withXSRFToken} = config;
let onCanceled;
function done() {
if (config.cancelToken) {
@@ -3437,13 +3428,16 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (platform.hasStandardBrowserEnv) {
// Add xsrf header
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
if(platform.hasStandardBrowserEnv) {
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
if (xsrfValue) {
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
// Add xsrf header
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
if (xsrfValue) {
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
}
}
}
@@ -3726,6 +3720,7 @@ function mergeConfig(config1, config2) {
timeout: defaultToConfig2,
timeoutMessage: defaultToConfig2,
withCredentials: defaultToConfig2,
withXSRFToken: defaultToConfig2,
adapter: defaultToConfig2,
responseType: defaultToConfig2,
xsrfCookieName: defaultToConfig2,
+1 -1
View File
File diff suppressed because one or more lines are too long