arturobernalg opened a new pull request, #1171: URL: https://github.com/apache/tomcat/pull/1171
When `exposeHeaders` is enabled, the `RateLimitFilter` now sends a `Retry-After` header (RFC 9110, section 10.2.3) with the 429 responses it sends when the limit is enforced (RFC 6585, section 4). The value is the time until the end of the current time bucket, rounded up to whole seconds. Nothing changes by default. The header is omitted if the delay is not known. That is the case if the time bucket changed while the request was being counted, as it is then not known which bucket counted the request, and if a custom `RateLimiter` does not provide the delay. `RateLimiter` gets a default method for this, so existing implementations keep working. Tests: `TestRateLimitFilterRetryAfter`, `TestRateLimiterRetryAfter`, and the existing rate limit filter tests. Also run against a running Tomcat with `FastRateLimiter` and `ExactRateLimiter`, HTTP/1.1 and HTTP/2, comparing with main. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
