Repository navigation
fix: respect If-None-Match in date-only conditional routes - #1868
Merged
pjfanning merged 1 commit intoNov 29, 2026
Merged
Conversation
Motivation: With no configured ETag, a concrete If-None-Match must still take precedence over If-Modified-Since on GET and HEAD. Modification: Continue past the date check for that case without changing wildcard or configured-tag behavior. Result: GET and HEAD proceed normally with both validators; date-only controls still return 304. Tests: Scala 2.13.18 (JDK 17): two regression cases failed as expected before the fix; all four focused cases passed after the fix. Scoped Scala formatting passed. References: RFC 9110 §§13.1.2–13.1.3 and 13.2.2.
He-Pin
marked this pull request as ready for review
November 29, 2026 06:44
pjfanning
reviewed
Nov 29, 2026
pjfanning
left a comment
Member
There was a problem hiding this comment.
The fix looks right to me: with no ETag configured a concrete If-None-Match list cannot match, so the condition is true and evaluation should skip If-Modified-Since (RFC 9110 §13.1.3 / §13.2.2 step 3). The tests cover GET and HEAD, plus the date-only case staying a 304.
Not for this PR, just noting: If-None-Match: * with only lastModified configured still falls through to step 4 and evaluates If-Modified-Since, which the same rule says should be ignored. That is existing behaviour and fine to leave as a possible follow-up.
pjfanning
approved these changes
Nov 29, 2026
He-Pin
added a commit
to He-Pin/incubator-pekko-http
that referenced
this pull request
Nov 29, 2026
### Motivation A native HTTP/2 conditional GET can return a bodyless 304 and advertise the known length of the selected representation. Preserve this opt-in behavior while integrating current main. ### Modification Keep the existing Scala and Java opt-in and emit the explicit length once for a native HTTP/2 conditional GET. Default omission, transparent HEAD, HTTP/1.1, and h2c replay stay unchanged; no length is inferred from the 304 entity. Resolve the conflicts while preserving apache#1868’s conditional precedence and apache#1861’s test coverage. ### Result Independent source review passed. On JDK 17, four focused cases passed on each of Scala 2.13.18 and 3.3.9. Scoped formatting passed for seven Scala files, and the Paradox documentation build passed. ### References - [RFC 9110 §8.6](https://www.rfc-editor.org/rfc/rfc9110.html#section-8.6) - [RFC 9113 §8.1.1](https://www.rfc-editor.org/rfc/rfc9113.html#section-8.1.1)
He-Pin
pushed a commit
that referenced
this pull request
Nov 29, 2026
…ional routes (#1881) Follow-up to #1868. With only a modification date configured, a request with If-None-Match: * fell through to If-Modified-Since. The wildcard matches any current representation and If-None-Match takes precedence over If-Modified-Since (RFC 9110 sections 13.1.2 and 13.1.3), so GET and HEAD now get 304 and other methods get 412. Co-authored-by: Claude Fable 5.2 <[email protected]>
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.
Motivation
A date-only conditional route can evaluate If-Modified-Since despite a concrete If-None-Match field taking precedence.
Modification
Keep concrete If-None-Match from falling through to If-Modified-Since when only Last-Modified is configured. Preserve date-only requests and existing wildcard behavior.
Result
GET and HEAD no longer return 304 solely because the date matched when a concrete If-None-Match is present. No public API changes.
Tests
References
None - standalone standards correction.
RFC 9110 §13.1.3 and §13.2.2.