Skip to content

Commit

Permalink
chore(release): v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrainJS committed Nov 14, 2023
1 parent 8739acb commit 4e091b3
Show file tree
Hide file tree
Showing 17 changed files with 209 additions and 202 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,27 @@
# Changelog

## [1.6.2](https://github.com/axios/axios/compare/v1.6.1...v1.6.2) (2023-11-14)


### Features

* **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc))

### PRs
- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
```
📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour.
You should now use withXSRFToken along with withCredential to get the old behavior.
This functionality is considered as a fix.
```

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+271/-146 (#6081 #6080 #6079 #6078 #6046 #6064 #6063 )")
- <img src="https://avatars.githubusercontent.com/u/79681367?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ng Choon Khon (CK)](https://github.com/ckng0221 "+4/-4 (#6073 )")
- <img src="https://avatars.githubusercontent.com/u/9162827?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Muhammad Noman](https://github.com/mnomanmemon "+2/-2 (#6048 )")

## [1.6.1](https://github.com/axios/axios/compare/v1.6.0...v1.6.1) (2023-11-08)


Expand All @@ -13,6 +35,15 @@
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+432/-65 (#6059 #6056 #6055 )")
- <img src="https://avatars.githubusercontent.com/u/3982806?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Fabian Meyer](https://github.com/meyfa "+5/-2 (#5835 )")

### PRs
- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old &#x60;withCredentials&#x60; behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
```
📢 This PR added &#x27;withXSRFToken&#x27; option as a replacement for old withCredentials behaviour.
You should now use withXSRFToken along with withCredential to get the old behavior.
This functionality is considered as a fix.
```

# [1.6.0](https://github.com/axios/axios/compare/v1.5.1...v1.6.0) (2023-10-26)


Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "1.6.1",
"version": "1.6.2",
"homepage": "https://axios-http.com",
"authors": [
"Matt Zabriskie"
Expand Down
85 changes: 38 additions & 47 deletions dist/axios.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/axios.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js.map

Large diffs are not rendered by default.

89 changes: 42 additions & 47 deletions dist/browser/axios.cjs
@@ -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';

function bind(fn, thisArg) {
Expand Down Expand Up @@ -1960,51 +1960,42 @@ function settle(resolve, reject, response) {

var 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() {}
};

/**
* Determines whether the specified URL is absolute
Expand Down Expand Up @@ -2061,7 +2052,7 @@ var 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}
Expand Down Expand Up @@ -2206,7 +2197,7 @@ var 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) {
Expand Down Expand Up @@ -2342,13 +2333,16 @@ var 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);
}
}
}

Expand Down Expand Up @@ -2631,6 +2625,7 @@ function mergeConfig(config1, config2) {
timeout: defaultToConfig2,
timeoutMessage: defaultToConfig2,
withCredentials: defaultToConfig2,
withXSRFToken: defaultToConfig2,
adapter: defaultToConfig2,
responseType: defaultToConfig2,
xsrfCookieName: defaultToConfig2,
Expand Down Expand Up @@ -2660,7 +2655,7 @@ function mergeConfig(config1, config2) {
return config;
}

const VERSION = "1.6.1";
const VERSION = "1.6.2";

const validators$1 = {};

Expand Down
2 changes: 1 addition & 1 deletion dist/browser/axios.cjs.map

Large diffs are not rendered by default.

0 comments on commit 4e091b3

Please sign in to comment.