Skip to content

Close the connection after a 1xx response with Connection: close - #527

Open
ericmj wants to merge 1 commit into
http1-empty-tefrom
http1-1xx-close
Open

ericmj wants to merge 1 commit into
http1-empty-tefrom
http1-1xx-close

Conversation

@ericmj

@ericmj ericmj commented Oct 16, 2026

Copy link
Copy Markdown
Member

The response fields of a request were reset after an informational response so the final response could be parsed, and that dropped the Connection options of the 1xx response. A "close" option in a 1xx response was ignored, and the connection stayed open for the requests pipelined behind it.

RFC 9112 9.6 has a client that receives "close" close the connection after reading the response containing it. A 1xx isn't the complete response, so Mint now keeps the option and closes the connection after the final response, handling it as if the final response carried it: the connection is closed after the final response, including a 101 or an HTTP/1.0 keep-alive one, and queued requests fail with :unprocessed. A 2xx response to CONNECT still keeps the connection open for the tunnel. Other Connection options of a 1xx response, such as keep-alive, don't apply to the final response.

The response fields of a request were reset after an informational
response so the final response could be parsed, and that dropped the
Connection options of the 1xx response. A "close" option in a 1xx
response was ignored, and the connection stayed open for the requests
pipelined behind it.

RFC 9112 9.6 has a client that receives "close" close the connection
after reading the response containing it. A 1xx isn't the complete
response, so Mint now keeps the option and closes the connection after
the final response, handling it as if the final response carried it:
the connection is closed after the final response, including a 101 or
an HTTP/1.0 keep-alive one, and queued requests fail with :unprocessed.
A 2xx response to CONNECT still keeps the connection open for the
tunnel. Other Connection options of a 1xx response, such as keep-alive,
don't apply to the final response.
@github-actions

Copy link
Copy Markdown

Coverage Report for CI Build 205

Coverage decreased (-0.05%) to 90.469%

Details

  • Coverage decreased (-0.05%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • 2 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

2 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
lib/mint/http2.ex 2 95.28%

Coverage Stats

Coverage Status
Relevant Lines: 2004
Covered Lines: 1813
Line Coverage: 90.47%
Coverage Strength: 700.53 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