Repository navigation
Accept LF-only HTTP headers with simpler bounded parsing - #616
Merged
Merged
Conversation
Read header lines through LF and use the existing value trimming for CRLF. Reject lines that exceed the fixed buffer rather than parsing their remainder as another header. Add coverage for both line endings, empty blocks, body preservation, boundary lengths, EOF and cancellation. Based on flagarde's PR #603. Current master also contains the dependency removal that fixes that PR's stale Windows GCC configure failure. Co-authored-by: flagarde <flagarde.programs@pm.me>
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.
HTTP peers that terminate headers with LF instead of CRLF currently fail parsing. Accept either ending by reading through LF and retaining the existing whitespace trimming. This reworks #603 with a smaller parser change and credits its original author, @flagarde, as a co-author.
Reject lines beyond the existing fixed-buffer limit instead of silently treating their remainder as another header. Regression tests cover both line endings, mixed and empty header blocks, body preservation, colon handling, boundary lengths, incomplete input and cancellation.
The Windows GCC failure on #603 occurred during CMake configuration because its pinned
cpp_linenoisecommit could not be checked out. This branch is based on current master, which already removes that FetchContent dependency in #605 and has passing Windows GCC CI. No additional workflow changes are needed.Validation:
clang-format --dry-run --Werrorandgit diff --checkpassed.The original fork disables maintainer edits, so these changes cannot be pushed directly to #603.