-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[core-rest-pipeline] Preserve header casing #18517
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ae9fd9d
[core-rest-pipeline] Preserve header casing
xirzec 39fb265
Merge branch 'main' into preserveHeaderCase
xirzec 6306d66
Fix some header casing breaks in identity
xirzec 8299544
undo identity changes
xirzec f311cba
Change toJSON to lowercase by default.
xirzec 2d3de2a
Update CHANGELOG and ApiView
xirzec a188abd
Merge branch 'main' into preserveHeaderCase
xirzec f82f4fd
Add identity changes back
xirzec 82cc9a9
PR feedback
xirzec 7bfd41f
Update tables batch tests
xirzec 7577a48
Merge branch 'main' into preserveHeaderCase
xirzec 1e382d3
Fix more tests
xirzec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
|
|
||
| import { assert } from "chai"; | ||
| import { createHttpHeaders } from "../src/httpHeaders"; | ||
|
|
||
| describe("HttpHeaders", () => { | ||
| it("toJSON() should use normalized header names", () => { | ||
| const rawHeaders = { | ||
| lowercase: "lower case value", | ||
| camelCase: "camel case value", | ||
| ALLUPPERCASE: "all upper case value" | ||
| }; | ||
| const normalizedHeaders = { | ||
| lowercase: "lower case value", | ||
| camelcase: "camel case value", | ||
| alluppercase: "all upper case value" | ||
| }; | ||
| const headers = createHttpHeaders(rawHeaders); | ||
|
|
||
| assert.deepStrictEqual(headers.toJSON(), normalizedHeaders); | ||
| }); | ||
|
|
||
| it("toJSON({preserveCase: true}) should keep the original header names", () => { | ||
| const rawHeaders = { | ||
| lowercase: "lower case value", | ||
| camelCase: "camel case value", | ||
| ALLUPPERCASE: "all upper case value" | ||
| }; | ||
| const headers = createHttpHeaders(rawHeaders); | ||
|
|
||
| assert.deepStrictEqual(headers.toJSON({ preserveCase: true }), rawHeaders); | ||
| }); | ||
|
|
||
| it("iteration should use original header names", () => { | ||
| const rawHeaders = { | ||
| lowercase: "lower case value", | ||
| camelCase: "camel case value", | ||
| ALLUPPERCASE: "all upper case value" | ||
| }; | ||
| const headers = createHttpHeaders(rawHeaders); | ||
|
|
||
| for (const [name, value] of headers) { | ||
| assert.include(rawHeaders, { [name]: value }); | ||
| } | ||
| }); | ||
| }); |
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
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
4 changes: 2 additions & 2 deletions
4
...wsers/batch_operations_sasconnectionstring/recording_should_handle_sub_request_error.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...ing/recording_should_send_a_set_of_create_actions_when_using_tabletransaction_helper.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...perations_sasconnectionstring/recording_should_send_a_set_of_create_batch_operations.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.