Skip to content

Fail requests pipelined behind a 101 response - #529

Open
ericmj wants to merge 1 commit into
http1-rfc9112-body-rulesfrom
http1-upgrade-pipelined
Open

ericmj wants to merge 1 commit into
http1-rfc9112-body-rulesfrom
http1-upgrade-pipelined

Conversation

@ericmj

@ericmj ericmj commented Oct 16, 2026

Copy link
Copy Markdown
Member

After a 101 response the connection stayed open with the queued requests in place, so bytes arriving later, which belong to the protocol the server switched to (RFC 9110 15.2.2), were parsed as HTTP/1 responses to those requests.

Queued requests now fail with the new :connection_upgraded error when the 101 response completes. Bytes arriving later are unexpected data as long as no new request is made on the connection. A failed request that was streaming its body can't stream the rest of it. :unprocessed isn't used because the pipelined request bytes reached the server as part of the new protocol, so the request might have been processed. The bytes after the 101 response in the same packet are still delivered as data for the upgrade request.

After a 101 response the connection stayed open with the queued
requests in place, so bytes arriving later, which belong to the protocol
the server switched to (RFC 9110 15.2.2), were parsed as HTTP/1
responses to those requests.

Queued requests now fail with the new :connection_upgraded error when
the 101 response completes. Bytes arriving later are unexpected data as
long as no new request is made on the connection. A failed request that
was streaming its body can't stream the rest of it. :unprocessed isn't
used because the pipelined request bytes reached the server as part of
the new protocol, so the request might have been processed. The bytes
after the 101 response in the same packet are still delivered as data
for the upgrade request.
@ericmj
ericmj added this pull request to stack #530 October 16, 2026 13:03
@github-actions

Copy link
Copy Markdown

Coverage Report for CI Build 0

Coverage decreased (-0.1%) to 90.498%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (5 of 6 lines covered, 83.33%).
  • 5 coverage regressions across 3 files.

Uncovered Changes

File Changed Covered %
lib/mint/http1.ex 6 5 83.33%

Coverage Regressions

5 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
lib/mint/http2.ex 3 95.53%
lib/mint/http1.ex 1 87.56%
lib/mint/http1/response.ex 1 96.05%

Coverage Stats

Coverage Status
Relevant Lines: 2010
Covered Lines: 1819
Line Coverage: 90.5%
Coverage Strength: 712.47 hits per line

馃挍 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant