Repository navigation
httputil: Remove support for "obsolete line folding" - #3765
Merged
Merged
Conversation
This optional part of the HTTP specification is no longer used in practice, and continuing to support it adds complexity and risk of DoS via quadratic performance on malicious data.
Previously, an HTTPInputError raised while parsing response headers happened before the delegate was marked as needing on_connection_close, and close() cleared the stream's close callback, so simple_httpclient never completed the request and it hung until the timeout. Now the delegate is told the connection closed, matching the behavior for errors raised after headers_received. Update test_multi_line_headers to expect an error from simple_httpclient now that line folding is no longer supported (curl still accepts it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016cNR4NyeuzQ1qFdqCk1yum
Rather than declaring per-implementation whether line folding is supported (which was wrong when --httpclient changes the default client), accept either a correctly unfolded header or a 599 error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016cNR4NyeuzQ1qFdqCk1yum
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.
This optional part of the HTTP specification is no longer used
in practice, and continuing to support it adds complexity and risk
of DoS via quadratic performance on malicious data.