You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repro: a 503 whose Retry-After header is all digits but wider than long, e.g. Retry-After: 99999999999999999999.
Cause: RetryAfterDecoder.apply accepts the value with ^[0-9]+\.?0*$ then calls Long.parseLong outside the try, so the NumberFormatException escapes the error decoder instead of being ignored the way a malformed date is.
Fix: move the numeric branch into the existing try and add NumberFormatException to the catch, so an out-of-range value returns null like the date branch.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the focused overflow fix and regression test. The test coverage, backwards-compatibility, and security gates pass, but the required ci/circleci: pr-build check is failing, so this cannot be approved or merged until CI is green.
The red ci/circleci: pr-build isn't coming from this branch. The Test step dies at compile, in JavaLoggerTest and LoggerRebufferTest, with Charset cannot be converted to RequestTemplate.
Those files still call Request.create(..., Util.UTF_8), but f9159cf changed that last parameter from Charset to RequestTemplate without updating them, so the core test sources don't compile on master either. This PR is based on master (21cd9f3) and only touches ErrorDecoder.java and RetryAfterDecoderTest.java, so it just inherits the breakage and the core test reactor never gets as far as running the new test.
Happy to rebase once master compiles again, or I can fold the one-line signature fix for those two test files into this PR if you'd rather unblock it here. Let me know which you prefer.
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
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.
Repro: a
503whoseRetry-Afterheader is all digits but wider thanlong, e.g.Retry-After: 99999999999999999999.Cause:
RetryAfterDecoder.applyaccepts the value with^[0-9]+\.?0*$then callsLong.parseLongoutside the try, so theNumberFormatExceptionescapes the error decoder instead of being ignored the way a malformed date is.Fix: move the numeric branch into the existing try and add
NumberFormatExceptionto the catch, so an out-of-range value returnsnulllike the date branch.