mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
fix(CSRF): fixed CSRF vulnerability CVE-2023-45857 (#6028)
Co-authored-by: DigitalBrainJS <robotshara@gmail.com>
This commit is contained in:
@@ -67,7 +67,7 @@ describe('xsrf', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should set xsrf header for cross origin when using withCredentials', function (done) {
|
||||
it('should not set xsrf header for cross origin when using withCredentials', function (done) {
|
||||
document.cookie = axios.defaults.xsrfCookieName + '=12345';
|
||||
|
||||
axios('http://example.com/', {
|
||||
@@ -75,7 +75,7 @@ describe('xsrf', function () {
|
||||
});
|
||||
|
||||
getAjaxRequest().then(function (request) {
|
||||
expect(request.requestHeaders[axios.defaults.xsrfHeaderName]).toEqual('12345');
|
||||
expect(request.requestHeaders[axios.defaults.xsrfHeaderName]).toEqual(undefined);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user