fix(transformData): normalize headers with formatHeader to fix case-sensitivity issues#7544
Open
wdskuki wants to merge 1 commit intoaxios:v1.xfrom
Open
fix(transformData): normalize headers with formatHeader to fix case-sensitivity issues#7544wdskuki wants to merge 1 commit intoaxios:v1.xfrom
wdskuki wants to merge 1 commit intoaxios:v1.xfrom
Conversation
…ensitivity issues Ensure headers are properly normalized with formatHeader during transformData. This fixes issues where Content-Type headers with different casing (e.g., 'Content-Type' vs 'content-type') were not being correctly recognized, causing automatic serialization of urlencoded data to fail. Fixes axios#7393
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7393
The automatic URL-encoded serialization fails when the Content-Type header uses initial uppercase letters. This is because headers.normalize() was called without the formatHeader parameter.
Changes:
Summary by cubic
Normalize headers with
formatHeaderintransformDatato fix case-sensitiveContent-Typehandling. Restores automatic URL-encoded serialization when header casing varies.Description
formatHeaderfromlib/core/AxiosHeaders.js.formatHeadertoheaders.normalize()inlib/core/transformData.js.headers.normalize()withoutformatHeaderfailed to match mixed-caseContent-Type, causing urlencoded serialization to be skipped.Testing
Content-Type,content-type, and other case variants.Written for commit 2b0e2cd. Summary will update on new commits.