Repository navigation
Honour an If-Range date only if it is a strong validator (#1742) - #1744
Merged
Merged
Conversation
RFC 9110 section 13.1.5: a server must ignore an If-Range date unless it is a strong validator, i.e. the Last-Modified is at least one second older than the response (section 8.8.2.2). Conditions.getRangeStatus only tested that the two dates were equal, so a resource modified less than a second ago was served as a 206 instead of a full 200. DateUtils.isStrong holds the rule, shared with Conditions.unchangedSince. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 28, 2026
|
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.



Fixes #1742
RFC 9110 section 13.1.5: a server must ignore an
If-Rangedate unless it is a strong validator, i.e. theLast-Modifiedis at least one second older than the response (section 8.8.2.2).Conditions.getRangeStatusonly tested that the two dates were equal, so a resource modified less than a second ago was served as206instead of a full200.DateUtils.isStrong(modificationDate, referenceDate)holds the rule, shared withConditions.unchangedSince.getRangeStatusalso requires the modification date to be strong against the current time (the responseDateis written later, so it cannot be earlier). A weak date means the range is ignored and the whole entity is sent. No new public API.Datefallback ofHeaderUtils(invalid header replaced by the reception time) is unchanged: RFC 9110 section 6.6.1 allows it. Only the Javadoc ofunchangedSincementions it.ConditionsTestCase,RangeFilterTestCase, wire-levelRangeRequestEndToEndTestCase,DateUtilsTestCase.Same fix on the other maintained versions: 3.0: #1743, 2.6: #1745
🤖 Generated with Claude Code