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

Fixed handling of array values for AxiosHeaders; #5085

Merged
merged 3 commits into from Oct 13, 2022

Conversation

DigitalBrainJS
Copy link
Collaborator

@DigitalBrainJS DigitalBrainJS commented Oct 10, 2022

Fixed handling of set-cookie headers as an array;
Closes #5028, #5083;

@@ -222,13 +216,13 @@ Object.assign(AxiosHeaders.prototype, {
return this;
},

toJSON: function() {
toJSON: function(asStrings) {
Copy link
Contributor

Choose a reason for hiding this comment

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

When is toJSON used? Cannot see anywhere where it is used with asString === true?
Are there cases where one wants arrays to be returned as string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When is toJSON used?

at least in test cases to make deep assertions, but...

asString === true

AxiosHeaders is a public class, so not 100% of its functionality should be used inside the Axios codebase, from the user's point of view, it should be a complete helper implementation for dealing with headers.

Copy link
Member

@jasonsaayman jasonsaayman left a comment

Choose a reason for hiding this comment

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

This looks good, thanks 👍

@jasonsaayman jasonsaayman merged commit 110ae9a into axios:v1.x Oct 13, 2022
@wallynm
Copy link

wallynm commented Oct 18, 2022

Was upgrading axios and discovered this issue, came here to see if had any quickfix and already fixed and working perfect! Thank you so much! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.0.0] Set-Cookie header in a response interceptor is not an array anymore
4 participants