fix: clear RN FormData content type#10898
Conversation
|
@cyphercodes thanks for working on this fix (#10895). I applied the changes from this PR locally to Is there any additional build step or generated bundle file that also needs to be updated for the change to take effect, or am I missing something here? |
|
Thanks for checking this. One likely gotcha: React Native resolves So a I re-checked locally on this branch:
For a local patch-package validation, try patching the generated dist entry that your RN bundler is resolving, or build axios from this branch and consume that generated package. |
* fix: clear RN FormData content type * docs: add React Native FormData release note --------- Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com> Co-authored-by: Jason Saayman <jasonsaayman@gmail.com>
Summary
Clear
Content-Typefor React NativeFormDataduring adapter config resolution so RN can build multipart requests instead of receiving axios' defaultapplication/x-www-form-urlencodedheader.Linked issue
Closes #10895
Changes
FormDatalike browser/web-workerFormDatawhen resolving adapter headers.resolveConfigbehavior and thedispatchRequestdefault header path.Checklist
index.d.tsandindex.d.cts) — N/A, no public API changeSummary by cubic
Clears the default Content-Type for React Native
FormDataduring adapter config resolution so RN can set the multipart boundary correctly. Fixes uploads being sent asapplication/x-www-form-urlencoded(notably on Android).Bug Fixes
FormDatalike browser/web-worker: unset Content-Type inresolveConfig.Notes
/docs/explaining RNFormDatanow auto-handlesContent-Type; release note added inPRE_RELEASE_CHANGELOG.md.tests/unit/helpers/resolveConfig.test.jsandtests/unit/core/dispatchRequest.test.js.Written for commit ff1f283. Summary will update on new commits. Review in cubic