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

Refactored AxiosHeaders class to fix #5067; #5169

Closed
wants to merge 2 commits into from

Conversation

DigitalBrainJS
Copy link
Collaborator

@DigitalBrainJS DigitalBrainJS commented Oct 20, 2022

This PR has potential breaking changes in AxiosHeaders class.

const headersA = new AxiosHeaders({x:1});
const headersB = headersA.concat({y:2}, {z:3}, 'foo: 1\nbar: 2');
const headersC = AxiosHeaders.concat({x:1}, {y:2}, {z:3})
  • set method (as well as the class constructor) now accepts a AxiosHeaders instance and raw headers string as the source
  • added instance iterator to iterate over resolved headers
  • added toString to serialize into a raw headers string
  • default content type now is undefined, not application/x-www-form-urlencoded. This step makes it easier to keep track of user-defined header values, which in turn simplifies the implementation of the AxiosHeaders class. However, the content header will still be added before the request is sent if it is not explicitly defined or disabled by the user. Only the place and method of adding this header inside the Axios have been changed.

Closes #5157;
Closes #5067;
Closes #5006;

@luisdeka
Copy link

luisdeka commented Nov 1, 2022

need this

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