Validate HTTP/2 response semantics - #518
Merged
Merged
Conversation
Streams are removed as soon as the server ends them with END_STREAM, so
a RST_STREAM frame on a stream still being tracked means the response
is incomplete. With the NO_ERROR code it was reported as {:done, ref},
both before any headers and in the middle of a body with a declared
content-length. It now produces {:server_closed_request, :no_error}.
…ed status codes RFC 9113 8.2.2 makes a message containing connection, keep-alive, proxy-connection, transfer-encoding or upgrade malformed, which is a stream error. The te header is only allowed in requests, so it's rejected in responses and trailers as well. A :status of 101 is not supported in HTTP/2 (RFC 9113 8.6) and used to be delivered as an interim response, and :status values below 100 were accepted although HTTP/1 rejects them; both are now stream errors.
Coverage Report for CI Build 5Coverage increased (+0.09%) to 89.646%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This was referenced Sep 27, 2026
ericmj
marked this pull request as ready for review
September 27, 2026 18:50
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.
Two commits, meant to be rebase-merged rather than squashed.
{:error, ref, %Mint.HTTPError{reason: {:server_closed_request, :no_error}}}instead of{:done, ref}. Streams are removed once the server ends them with END_STREAM, so the response is incomplete at that point. A server that sends a complete response with END_STREAM followed by RST_STREAM NO_ERROR (RFC 9113 8.1) is unaffected.:status101 is a stream error (RFC 9113 8.6) instead of being delivered as an interim response, and:statusvalues below 100 are rejected as in HTTP/1.