Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/core/index.js",
"typings": "index.d.ts",
"license": "MIT",
"version": "3.101.3",
"version": "3.102.0",
"author": "kobezzza <kobezzza@gmail.com> (https://github.com/kobezzza)",
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions src/core/request/engines/fetch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Changelog
> - :house: [Internal]
> - :nail_care: [Polish]

## v3.102.0 (2025-06-04)

#### :boom: Breaking Change

* Unified behavior of the `credentials` parameter: now the value `false` completely removes cookies for all requests

## v3.78.0 (2022-03-16)

#### :rocket: New Feature
Expand Down
3 changes: 3 additions & 0 deletions src/core/request/engines/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const request: RequestEngine = (params) => {
if (Object.isString(p.credentials)) {
credentials = p.credentials;

} else if (p.credentials === false) {
credentials = 'omit';

} else if (p.credentials) {
credentials = 'include';
}
Expand Down
6 changes: 6 additions & 0 deletions src/core/request/engines/xhr/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Changelog
> - :house: [Internal]
> - :nail_care: [Polish]

## v3.102.0 (2025-06-04)

#### :boom: Breaking Change

* Unified behavior of the `credentials` parameter: now the value `false` completely removes cookies for all requests

## v3.78.0 (2022-03-16)

#### :rocket: New Feature
Expand Down
18 changes: 16 additions & 2 deletions src/core/request/engines/xhr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,22 @@ const request: RequestEngine = (params) => {
xhr.responseType = 'arraybuffer';
}

if (p.credentials !== false) {
xhr.withCredentials = true;
switch (p.credentials) {
case 'omit':
case false:
xhr.withCredentials = false;
xhr.setRequestHeader('Cookie', '');
break;

case 'include':
case true:
xhr.withCredentials = true;
break;

case 'same-origin':
default:
xhr.withCredentials = false;
break;
}

if (p.headers) {
Expand Down
Loading