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

Treat Set-Cookie header as an array. #13

Merged
merged 1 commit into from Feb 12, 2024

Conversation

sanny-io
Copy link
Contributor

This package currently handles the Set-Cookie header like any other header, but axios actually treats this header as an array of strings. In the current implementation, user-code attempting to loop over each cookie actually loops over each character of the last cookie.

This pull request fixes the package to match the behavior of axios.

Related:

axios/axios#5085

https://github.com/axios/axios/blob/a52e4d9af51205959ef924f87bcf90c605e08a1e/test/specs/helpers/parseHeaders.spec.js#L19-L32
https://github.com/axios/axios/blob/a52e4d9af51205959ef924f87bcf90c605e08a1e/lib/helpers/parseHeaders.js#L43-L48

Copy link
Member

@cuibonobo cuibonobo left a comment

Choose a reason for hiding this comment

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

Thank you!

@cuibonobo cuibonobo merged commit 54beb50 into haverstack:main Feb 12, 2024
@sanny-io sanny-io deleted the fix-set-cookie-header branch February 12, 2024 02:53
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.

None yet

2 participants