{{ message }}
gh-54930: Send a status line in error responses to malformed request lines#152980
Open
serhiy-storchaka wants to merge 1 commit into
Open
gh-54930: Send a status line in error responses to malformed request lines#152980serhiy-storchaka wants to merge 1 commit into
serhiy-storchaka wants to merge 1 commit into
Conversation
…quest lines Previously such error responses were sent in the bare HTTP/0.9 style, without a status line and headers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Previously, if the request line could not be parsed (malformed or unsupported version, bad syntax, or a non-GET two-word request), the error response was sent in the bare HTTP/0.9 style, without a status line and headers, because the request version defaulted to
"HTTP/0.9". The client received raw HTML and could not see the 400 or 505 status.Now only a valid HTTP/0.9 request (a two-word GET request line) receives an HTTP/0.9 style response.
The other defect discussed in the issue (deadlock on a one-line HTTP/0.9 request) was fixed in gh-70765. The test suite previously worked around the present defect by setting
default_request_version = 'HTTP/1.1'in its test handlers.🤖 Generated with Claude Code