Repository navigation
Conversation
… faulty framing, and its connection closed, rather than read as chunked RFC 9112 6.1: a client that receives an HTTP/1.0 message with a Transfer-Encoding MUST treat its framing as faulty and close the connection after it. The client takes its framing from Glyph11, which had no such rule. Glyph11 0.4.1 refuses the message in its hardened parsers (dotnet-web-stack/Glyph11#91), and the client turns that into a failed request on a discarded connection, as it does any malformed head. The client moves from Glyph11 0.3.7 to 0.4.1, onto TryParseResponseHeader: TryExtractFullResponseHeaderROM is obsolete since 0.4.0, and the new entry point reports the header block's true length, so the + 1 goes. Glyph11's other response fixes since 0.3.7 come with it, among them a bare-LF head refused at once rather than waited on (Glyph11#85), status codes above 599 refused (Glyph11#80), and Content-Length lists and oversized values framed by their length (Glyph11#74, Glyph11#75, Glyph11#77). HttpClientHttp10Tests: the issue's test, a 304, and a keep-alive response whose connection must not be reused, beside the Content-Length control. On Glyph11 0.4.0 the three refusals fail; on 0.4.1 they pass.
# Conflicts: # tests/Ioxide.Tests.Http/Program.cs
Merged
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.
Fixes #541.
RFC 9112 §6.1: "A server or client that receives an HTTP/1.0 message containing a Transfer-Encoding header field MUST treat the message as if the framing is faulty, even if a Content-Length is present, and close the connection after processing the message."
The client takes its framing from Glyph11, which had no such rule, so
HTTP/1.0 200 OKwithTransfer-Encoding: chunkedand a chunkedhellocame back as200|hello. Glyph11 0.4.1 refuses the message in both of its hardened parsers (dotnet-web-stack/Glyph11#91). The client turns a refused head into a failed request on a connection it discards, as it does any malformed head, so the connection is never reused.Glyph11 0.3.7 to 0.4.1.
TryExtractFullResponseHeaderROMis obsolete since 0.4.0. The client callsTryParseResponseHeader, which reports the header block's true length, so the+ 1goes. Glyph11's other response fixes since 0.3.7 come along, and they are the behaviour changes to know:The rule is on the field. A 304 or a HEAD response with Transfer-Encoding is refused too, though it has no body to misread: the RFC names the field, and Glyph11 checks it.
Tests.
HttpClientHttp10Tests: the issue's test, a 304, and a keep-alive response whose connection must not be reused, beside an HTTP/1.0 response with Content-Length, which is read. On Glyph11 0.4.0 the three refusals fail; on 0.4.1 they pass.Suites. Http 99/0 and Unit 211/0, the two suites that reference ioxide.httpclient.