Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing ignore set withCredentials false #1852

Closed
wants to merge 7 commits into from
Closed
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/adapters/xhr.js
Expand Up @@ -122,11 +122,10 @@ module.exports = function xhrAdapter(config) {
});
}

// Add withCredentials to request if needed
if (config.withCredentials) {
request.withCredentials = true;
// Add withCredentials to request if needed. Explicit to set a true or false
if (typeof config.withCredentials !== 'undefined') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the isUndefined function of utils.

axios/lib/utils.js

Lines 84 to 86 in 8414664

function isUndefined(val) {
return typeof val === 'undefined';
}

request.withCredentials = !!config.withCredentials;
}

// Add responseType to request if needed
if (config.responseType) {
try {
Expand Down