Skip to content
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

[HTTP/3] Fix QPACK status decode #57236

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

CarnaViire
Copy link
Member

Fix "Literal Header Field With Name Reference" parsing for Status code. Add tests for QPACK-ed and not QPACK-ed status receiving for all status codes (except informational).

Fix QPackStaticTable.HeaderLookup to comply with spec https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#name-static-table-2 (the order was off, so lookup didn't work correctly in some cases).

Fixes #55988

Notes:

  1. While checking spec compliance, I noticed that index 34 should access-control-allow-headers instead of access-control-allow-origin (in H3StaticTable.s_staticTable). It seems to be shared code, so I guess after this PR Kestrel will need to sync with the update? cc @JamesNK

  2. It would be nice to get rid of QPackStaticTable.HeaderLookup in favor of H3StaticTable.s_staticTable, or use a generation of some sort, but I didn't check whether it will be easy to achieve, and I don't know why there are two of them in the first place.

@ghost
Copy link

ghost commented Aug 11, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix "Literal Header Field With Name Reference" parsing for Status code. Add tests for QPACK-ed and not QPACK-ed status receiving for all status codes (except informational).

Fix QPackStaticTable.HeaderLookup to comply with spec https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#name-static-table-2 (the order was off, so lookup didn't work correctly in some cases).

Fixes #55988

Notes:

  1. While checking spec compliance, I noticed that index 34 should access-control-allow-headers instead of access-control-allow-origin (in H3StaticTable.s_staticTable). It seems to be shared code, so I guess after this PR Kestrel will need to sync with the update? cc @JamesNK

  2. It would be nice to get rid of QPackStaticTable.HeaderLookup in favor of H3StaticTable.s_staticTable, or use a generation of some sort, but I didn't check whether it will be easy to achieve, and I don't know why there are two of them in the first place.

Author: CarnaViire
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@Tratcher
Copy link
Member

  1. It seems to be shared code, so I guess after this PR Kestrel will need to sync with the update?

The sync from runtime to aspnetcore is automatic. Thanks for the heads up.

H3StaticTable.Status425 => 425,
H3StaticTable.Status500 => 500,
// We should never get here, at least while we only use static table. But we can still parse staticValue.
_ => ParseStatusCode(staticIndex, staticValue)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this error? I'm not familiar with this code, but I think you're using the static index to resolve to a descriptor, and the descriptor must be :status, so any other static index at this point should be impossible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see a Debug.Fail. As long as weirdness here gets noticed then that's fine 👍

Copy link
Member

@ManickaP ManickaP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@CarnaViire CarnaViire merged commit d27eb8d into dotnet:main Aug 12, 2021
@CarnaViire CarnaViire deleted the fix-qpack-status-decode branch August 12, 2021 15:06
@Tratcher
Copy link
Member

FYI I triggered the sync bot manually so we could get this into aspnetcore quickly. dotnet/aspnetcore#35293

@karelz karelz added this to the 6.0.0 milestone Aug 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HTTP/3] The server returned an invalid or unrecognized response.
5 participants