Repository navigation
Reject malformed numeric Retry-After values - #9019
Open
Dhruvraj-Rana wants to merge 2 commits into
Open
Dhruvraj-Rana wants to merge 2 commits into
Dhruvraj-Rana wants to merge 2 commits into
Conversation
|
|
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-08 08:39 UTC Review the latest changes. Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9019 +/- ##
============================================
+ Coverage 90.35% 90.37% +0.02%
- Complexity 11017 11021 +4
============================================
Files 1021 1021
Lines 30128 30130 +2
Branches 3933 3934 +1
============================================
+ Hits 27221 27230 +9
+ Misses 1953 1941 -12
- Partials 954 959 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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 #9018.
RetryUtilcurrently usesLong.parseLongforRetry-Afterdelay-seconds, which also accepts a leading sign and non-ASCII digits. Consequently, headers such as+30and-0override the normal retry backoff despite being malformed under RFC 9110 section 10.2.3, where delay-seconds is1*DIGIT.Validate that a parsed numeric value contains only ASCII digits before using it as a delay. Malformed numeric values return an empty
OptionalLong, allowing the existing retry policy to apply. Valid zero and leading-zero values remain supported, and the HTTP-date parsing path is unchanged.The parameterized tests cover positive signs, negative zero, non-ASCII digits, empty input, zero, and leading zeros alongside the existing seconds and date cases.
Validation on Java 25:
./gradlew :exporters:common:spotlessApply :exporters:common:checkpasses: 105 tests across the main, sender-provider, and without-Unsafe suites, with no failures or skips. Checkstyle, Spotless, Animal Sniffer, and jApiCmp pass.git diff --checkpasses. No generated API diff files changed.The full repository and CI platform/JDK matrix were not run; validation is scoped to the affected module.