Accept optional whitespace around commas when parsing If-None-Match - #5454
Open
iprithv wants to merge 1 commit into
Open
Accept optional whitespace around commas when parsing If-None-Match#5454iprithv wants to merge 1 commit into
iprithv wants to merge 1 commit into
Conversation
adutra
approved these changes
Sep 7, 2026
flyingImer
approved these changes
Sep 8, 2026
flyingImer
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, no blocking concerns with this change. I just closed and re-opened the pr to see if the CI will pass
dimas-b
approved these changes
Sep 8, 2026
| String etagValue3 = "W/\"etag3\""; | ||
|
|
||
| IfNoneMatch ifNoneMatch = | ||
| IfNoneMatch.fromHeader(etagValue1 + " , " + etagValue2 + "\t,\t" + etagValue3); |
Contributor
There was a problem hiding this comment.
Technically we're missing the cases of multiple / mixed / before-only / after-only spaces/tabs.
Should this be a parameterized test with some more extensive input permutations?
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.
The
If-None-Matchparser hard-codes the list separator as a comma followed by exactly one space (", "). Per RFC 9110, Section 5.6.1 (the#rulelist extension, formerly RFC 7230, Section 7), list elements are separated by a comma with optional surrounding whitespace (OWS = *( SP / HTAB )). Valid headers such asW/"a",W/"b"orW/"a" , W/"b"are therefore rejected with 400.This relaxes the separator to allow zero or more spaces or tabs on either side of the comma. ETag matching semantics are unchanged; only list parsing is affected. See RFC 9110, Section 13.1.2 for
If-None-Match.