-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Fix incorrect HTTP/2 method header decoding #40412
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
Conversation
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
Tratcher
reviewed
Feb 25, 2022
src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeadersEnumerator.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs
Show resolved
Hide resolved
adityamandaleeka
approved these changes
Feb 28, 2022
e6e9ebb
to
d49e46f
Compare
halter73
approved these changes
Mar 1, 2022
😆 |
/backport to release/7.0-preview2 |
Started backporting to release/7.0-preview2: https://github.com/dotnet/aspnetcore/actions/runs/1913774976 |
@adityamandaleeka backporting to release/7.0-preview2 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: WIP - Fix incorrect h2 header decoding.
Applying: Fix test
Using index info to reconstruct a base tree...
M src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj
M src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj
Falling back to patching base and 3-way merge...
Auto-merging src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj
CONFLICT (content): Merge conflict in src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj
Auto-merging src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj
CONFLICT (content): Merge conflict in src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Fix test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
adityamandaleeka
added a commit
to adityamandaleeka/aspnetcore
that referenced
this pull request
Mar 1, 2022
Co-authored-by: Aditya Mandaleeka <[email protected]>
mmitche
pushed a commit
that referenced
this pull request
Mar 1, 2022
Co-authored-by: Aditya Mandaleeka <[email protected]> Co-authored-by: James Newton-King <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
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 #40301
@adityamandaleeka It's my Saturday tomorrow so I just went ahead and created a PR. The only fix required was
_hpackDecoder.Decode
after the first stream.With HPACK, the response headers from the first stream tell the decoder that the headers should be added to the dynamic table. They are now available for the second stream which sends back response headers that use dynamic table indexes. Example: https://datatracker.ietf.org/doc/html/rfc7541#appendix-C.5
If you've ever wondered why HPACK was replaced by QPACK in HTTP/3, it's because HTTP/2 guarantees the order of delivery. With HTTP/2 the server knows exactly what is the client's dynamic table based on what it has sent. That means it can safely send a header identified with a dynamic header index. HTTP/3 doesn't guarantee the order of delivery (e.g. stream 3 response headers are received before stream 1 response headers) so a new header compression spec is required.