-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: http content headers not sent when using axios #8039
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
base: main
Are you sure you want to change the base?
fix: http content headers not sent when using axios #8039
Conversation
We use conventional commits, so the title of this should be something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just need to fix the title.
Updated, thanks for the call out! |
I personally don't like this approach of setting the content-type ourselves. First of all, this change affects both fetch and XHR, but fetch is working fine without this change. Second, this change prevent's users from setting their own boundary since both headers get sent to the native code, the user provided one and the hardcoded one, and the native code sometimes picks the user provided one and other times it picks the hardcoded one. Can at least be done only for XHR and check if the user provided a content-type header to not hardcode it in that case? |
Fixed |
The headers were not being set correctly when CapacitorHttp is set. The missing headers were Content-Type and Content-Length.
Video: https://github.com/user-attachments/assets/482e3a3b-1e0e-43fc-8648-7ad65ad81b05
closes:#7579