Skip to content

[core-http] Add support for headers having original casing during deserialization.#22888

Merged
xirzec merged 2 commits intoAzure:mainfrom
xirzec:fixHeaderDeserialization
Aug 15, 2022
Merged

[core-http] Add support for headers having original casing during deserialization.#22888
xirzec merged 2 commits intoAzure:mainfrom
xirzec:fixHeaderDeserialization

Conversation

@xirzec
Copy link
Copy Markdown
Member

@xirzec xirzec commented Aug 12, 2022

Packages impacted by this PR

@azure/core-http and its dependents

Issues associated with this PR

Fixes #22881

Describe the problem that is addressed by this PR

node-fetch forces a lowercase normalization of header names coming over the wire, but storage has scenarios where this is undesirable (see #8117).

Until we get storage moved over to the new pipeline, we would like advanced consumers to be able to preserve header casing via a custom HttpClient.

This PR addresses the issue by ensuring we pass the normalized (rather than the original) header casing to the deserialization policy which always hardcodes the lowercase version of the name.

Are there test cases added in this PR? (If not, why?)

Yes! Two new cases, one for normal responses and one for error responses.

@ghost ghost added the Azure.Core label Aug 12, 2022
@xirzec xirzec requested review from EmmaZhu and joheredi August 12, 2022 22:13
@xirzec xirzec added the Client This issue points to a problem in the data-plane of the library. label Aug 12, 2022
@azure-sdk
Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

@xirzec xirzec enabled auto-merge (squash) August 15, 2022 15:54
@xirzec xirzec merged commit aea4e9a into Azure:main Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Header deserialization should be case insensitive

3 participants