Repository navigation
Treat the HTTP/2 Expect field value as a list of expectations - #1265
Open
arturobernalg wants to merge 2 commits into
Open
arturobernalg wants to merge 2 commits into
arturobernalg wants to merge 2 commits into
Conversation
RFC 9110, section 10.1.1 defines the Expect field value as case-insensitive. HTTP/1.1 already compares 100-continue ignoring case but HTTP/2 did not, so no 100 (Continue) response was sent for a request with "Expect: 100-Continue".
RFC 9110, section 10.1.1 defines Expect as a list. A request with "Expect: foo, 100-continue" over HTTP/2 got neither a 100 (Continue) response nor an immediate final response, so the server waited for the request content.
arturobernalg
force-pushed
the
http2-expect-list
branch
from
November 20, 2026 16:32
4eaf880 to
d39d174
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This builds on #1263, which is its first commit. Only the second commit is new; I will rebase once #1263 is merged.
RFC 9110, section 10.1.1 defines Expect as a list (
Expect = #expectation). An origin server that receives a request whose header section "contains a 100-continue expectation and an indication that request content will follow" MUST send either an immediate final response or an immediate 100 (Continue) response. Over HTTP/2, a request withExpect: foo, 100-continuegot neither and the server waited for the request content.With curl, a 200 KB POST and an 8 second expect timeout:
100-continue, foofoo, 100-continue100-continue,100-continueThe value is now parsed with
TokenList.parseTokenList(), the list parser already used for Connection and Transfer-Encoding, after a fast path for a single100-continue. Other expectations are ignored: the 417 response is only a MAY and HTTP/2 already ignoredExpect: foo. HTTP/1.1 is not changed.testSendAckList and testSendAckListWithEmptyElements in TestHttp2Section_8_1 fail without the change; testNoAckForOtherExpectation and testNoAckForContinueWithParameter check that no 100 (Continue) response is sent for
fooor100-continue=1.Known limitation: TokenList does not handle quoted strings, so an expectation such as
foo="a, 100-continue, b"also gets a 100 (Continue) response. That is harmless, as RFC 9110, section 15.2 says "A client MUST be able to parse one or more 1xx responses received prior to a final response, even if the client does not expect one."