Parse extension headers with HTTP whitespace and full boundaries - #9
Open
OskarEichler wants to merge 3 commits into
Open
Parse extension headers with HTTP whitespace and full boundaries#9OskarEichler wants to merge 3 commits into
OskarEichler wants to merge 3 commits into
Conversation
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.
Summary
Accept space/tab HTTP whitespace around delimiters and require complete header/value matches. Avoid returning a partial parse from a matching line within a larger string.
Reproduction and verification
261 focused whitespace/boundary cases pass. RFC 6455 section 9.1 uses the implied HTTP whitespace rule: https://www.rfc-editor.org/rfc/rfc6455.html#section-9.1 . Transport-level folded header lines must be unfolded before parsing. Existing broader quoted-string acceptance is deliberately unchanged. Paired small-header measurements show about 0.12 microseconds additional parsing cost (1.804 to 1.926 microseconds); this is handshake parsing, not a message-throughput speedup claim.
Breaking changes and limitations
Intentional correction: invalid unquoted newline suffixes/prefixes now raise ParseError instead of producing partial/empty results; supported space/tab formatting is accepted. Numeric coercion checks the entire decoded value.
Only local Ruby 4.0.6/macOS execution is claimed; the repository's older Ruby/JRuby matrix needs upstream CI. No production access or unrelated release upgrades.