-
Notifications
You must be signed in to change notification settings - Fork 909
Test multi-value headers #1498
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
greenEkatherine
merged 14 commits into
dotnet:main
from
greenEkatherine:test-multi-value-headers
Jan 17, 2022
Merged
Test multi-value headers #1498
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
85cdbe9
Test multi-value headers
ac3e4e7
Split request and response headers and make separate scenario for emp…
0e0407e
added HTTP/1.1 scenarios for multi-value headers
f8df306
Added multi-value headers test
0abedc5
added more tests for specific multi-value Cookie header
1cc833f
Align expected values for request and response, fix status code in re…
ba57661
Handle empty multi-value headers in unit tests
963ea14
Merge branch 'main' into test-multi-value-headers
27a1927
added functional test for response and switch to non-validated header…
ebd1b75
move all non-validated headers under .NET 6.0 condition
dde8e7e
Update test/ReverseProxy.FunctionalTests/HeaderTests.cs
edc4067
fix nullability
389f7a7
Apply suggestions from code review
420aff1
fixing tests after addressing feedback
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
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.
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.
So Kestrel preserves mutli-value request headers, but HttpClient doesn't? Please file an issue for that in runtime.
Uh oh!
There was an error while loading. Please reload this page.
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.
You mean the fact that HttpClient will send multiple values on the same line? That is by design.
Or rather, a known byproduct of how headers are implemented.
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.
That design will be a problem for proxy scenarios. Being as transparent as possible includes not changing the header format.
Uh oh!
There was an error while loading. Please reload this page.
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.
dotnet/runtime#62981 (before the last commit) would allow you to get headers serialized in multiple lines, if you called
TryAddWithoutValidationmultiple times. We decided against that as a potentially breaking change for little/no perf benefit.Even then, it was done on a best-effort basis, as accessing a value / enumerating the collection would force us to group the entries back into a single line.
Have we heard any requests to support this? I don't believe I've seen anything in runtime yet (though I agree a proxy might be more sensitive).
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.
We have had specific complaints about response headers, so we've been very careful about this on the server side. I'm not aware of specific complaints about request headers yet. These tests were done as a precaution to understand and document the current behavior.
The inability to preserve header formats in one direction is notable, but we won't know if it's blocking until a customer notices. I'm surprised our recent partner deployments didn't notice. Now is a good time to check if there are easy workarounds or fixes so we're prepared when it does come up.
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.
dotnet/runtime#63808