-
-
Notifications
You must be signed in to change notification settings - Fork 7k
cf-h1-proxy: support folded headers in CONNECT responses #20080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for folded headers (obsolete line folding per RFC 7230) in HTTP CONNECT responses. Folded headers allow a header value to span multiple lines when continuation lines start with whitespace (space or tab). The implementation unfolds these headers by stripping trailing whitespace from the main line and replacing leading whitespace on continuation lines with a single space.
Key changes:
- Implements folded header parsing in the CONNECT response handler (
lib/cf-h1-proxy.c) - Removes now-unused folded header handling from the generic dynamic headers module (
lib/dynhds.c) - Updates test1941 to verify correct handling of folded headers in CONNECT responses
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/cf-h1-proxy.c | Adds two state flags (maybe_folded and leading_unfold) to track header folding state; implements folded header detection and unfolding logic; extracts header processing into a new single_header helper function |
| lib/dynhds.c | Removes the entry_append function and folded header continuation handling from the generic H1 header parsing, as this is now handled at a higher level in the CONNECT proxy code |
| tests/data/test1941 | Updates CONNECT response test data to include folded headers: Content-Type header with value on continuation line, and Server header folded across three lines |
| tests/unit/unit2602.c | Removes unit tests for header continuation handling that is no longer supported in the dynhds module |
| tests/unit/unit2603.c | Removes TEST5a which tested folded header parsing in the generic request parser, as this functionality has been moved to the CONNECT-specific handler |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d0cecfe to
ea033a0
Compare
|
augment review |
🤖 Augment PR SummarySummary: This PR teaches the HTTP/1 proxy CONNECT filter to accept and unfold obsolete “folded” (obs-fold) header lines in CONNECT responses. Changes:
Technical Notes: CONNECT parsing now defers emitting a header line until it can determine whether the next line begins with whitespace (folded) or starts a new header. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update test 1941 to verify this Remove unused code from dynhds for handling folded headers, and the associated unit tests of those functions in test 2602 and 2603. Closes #20080
170e394 to
cbeada2
Compare
Update test 1941 to verify this
Remove unused code from dynhds for handling folded headers.