Repository navigation
Use HTTP dates in ReadOnlyHttp2Headers.containsTimeMillis - #18271
Merged
normanmaurer merged 2 commits intoNov 5, 2026
Merged
normanmaurer merged 2 commits into
normanmaurer merged 2 commits into
Conversation
Motivation: ReadOnlyHttp2Headers.getTimeMillis reads HTTP dates, but containsTimeMillis searches for decimal epoch milliseconds. Modification: Use CharSequenceValueConverter.convertTimeMillis, as writable headers do. Result: Read-only and writable HTTP/2 headers use the same representation for time values. Raw decimal millisecond headers no longer match containsTimeMillis; callers handling numeric headers should use containsLong.
Cover matching HTTP dates, different timestamps, and decimal millisecond values that should use containsLong.
✅ All tests passed ✅🏷️ Commit: e6701c6 Learn more about TestLens at testlens.app/docs. |
Member
|
@wozhenbang2004 please sign our icla and let me know once done: https://netty.io/s/icla |
Contributor
Author
|
Thanks @normanmaurer, I've submitted the ICLA. |
Contributor
|
Auto-port PR for 5.0: #18286 |
Contributor
|
Auto-port PR for 4.1: #18287 |
chrisvest
pushed a commit
that referenced
this pull request
Nov 5, 2026
…lis (#18286) Auto-port of #18271 to 5.0 Cherry-picked commit: 7599557 --- Motivation: `ReadOnlyHttp2Headers.getTimeMillis` reads HTTP dates, but `containsTimeMillis` searches for decimal epoch milliseconds. A valid HTTP-date header therefore cannot be found with the matching timestamp. Modification: Use `CharSequenceValueConverter.convertTimeMillis`, as writable headers do. Add a regression test covering a matching HTTP date, a different timestamp, and a raw decimal value. Result: Read-only and writable HTTP/2 headers use the same representation for time values. This changes the previous behavior for raw decimal millisecond headers: they no longer match `containsTimeMillis`; callers handling numeric headers should use `containsLong`. Co-authored-by: Kayokoi <[email protected]>
chrisvest
pushed a commit
that referenced
this pull request
Nov 6, 2026
…lis (#18287) Auto-port of #18271 to 4.1 Cherry-picked commit: 7599557 --- Motivation: `ReadOnlyHttp2Headers.getTimeMillis` reads HTTP dates, but `containsTimeMillis` searches for decimal epoch milliseconds. A valid HTTP-date header therefore cannot be found with the matching timestamp. Modification: Use `CharSequenceValueConverter.convertTimeMillis`, as writable headers do. Add a regression test covering a matching HTTP date, a different timestamp, and a raw decimal value. Result: Read-only and writable HTTP/2 headers use the same representation for time values. This changes the previous behavior for raw decimal millisecond headers: they no longer match `containsTimeMillis`; callers handling numeric headers should use `containsLong`. Co-authored-by: Kayokoi <[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:
ReadOnlyHttp2Headers.getTimeMillisreads HTTP dates, butcontainsTimeMillissearches for decimal epoch milliseconds. A valid HTTP-date header therefore cannot be found with the matching timestamp.Modification:
Use
CharSequenceValueConverter.convertTimeMillis, as writable headers do. Add a regression test covering a matching HTTP date, a different timestamp, and a raw decimal value.Result:
Read-only and writable HTTP/2 headers use the same representation for time values. This changes the previous behavior for raw decimal millisecond headers: they no longer match
containsTimeMillis; callers handling numeric headers should usecontainsLong.