Repository navigation
Preserve folded request header values - #897
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
Continuation lines currently overwrite earlier values for ordinary headers and add commas to list-valued headers. Joining continuations with spaces preserves the field value while keeping repeated fields subject to the existing header rules. Real socket tests cover spaces, tabs, multiple lines, empty initial values, and repeated fields. Five cases fail without the change. Fixes cherrypy#726 Assisted-by: LLM
Automation signalsActivity patterns show signs of automation. Evidence
Last 5 PRs:
This is an automated analysis by AgentScan |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #897 +/- ##
==========================================
+ Coverage 75.95% 76.20% +0.25%
==========================================
Files 41 42 +1
Lines 4932 4960 +28
Branches 561 562 +1
==========================================
+ Hits 3746 3780 +34
+ Misses 1046 1043 -3
+ Partials 140 137 -3 |
This branch has not been deployed
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.
What kind of change does this PR introduce?
What do these changes do?
Join header continuation lines with spaces. Previously, ordinary headers lost all but the last line, while list-valued headers gained commas between continuation lines. Repeated header fields retain their existing behavior.
Are there changes in behavior for the user?
Test: a\r\n b\r\n cnow reaches the application asa b c, as permitted by RFC 9112 section 5.2. The same unfolding applies to list-valued headers such as Accept.Is it a substantial burden for the maintainers to support this?
The change uses the existing header parsing path. Eight real-socket cases cover whitespace, multiple continuation lines, empty initial values and repeated fields. Five fail on the unmodified code; all eight pass with the fix.
Full tox tests on Windows/Python 3.12: 208 passed, 11 existing skips, 4 existing expected failures and one existing TLS client-auth error-text failure. All applicable pre-commit hooks passed; tox's existing reporting snippets fail on unescaped Windows paths. No checks were relaxed.
AI assistance: Codex implemented and tested this change locally.
Related issue number
Fixes #726.
Checklist
Tip
New to open source contributions? Making a lovely PR is a great read.
and description in grammatically correct, complete sentences
docs/) and inline docstrings reflect the changes(see good commit messages)
(can be done once the PR number is known; alternatively, you can
use a related issue number if one exists)
code of conduct