This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 82f1e879d7eaca6307ef734c2dc129977fd07ab5 Author: Mark Thomas <[email protected]> AuthorDate: Wed Mar 18 17:45:53 2026 +0000 Use the new status code constants --- java/org/apache/catalina/filters/RateLimitFilter.java | 2 +- java/org/apache/catalina/valves/PersistentValve.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/filters/RateLimitFilter.java b/java/org/apache/catalina/filters/RateLimitFilter.java index 17f630b92f..e815a971be 100644 --- a/java/org/apache/catalina/filters/RateLimitFilter.java +++ b/java/org/apache/catalina/filters/RateLimitFilter.java @@ -116,7 +116,7 @@ public class RateLimitFilter extends FilterBase { /** * Default status code to return if requests per duration is exceeded. */ - public static final int DEFAULT_STATUS_CODE = 429; + public static final int DEFAULT_STATUS_CODE = HttpServletResponse.SC_TOO_MANY_REQUESTS; /** * Default status message to return if requests per duration is exceeded. diff --git a/java/org/apache/catalina/valves/PersistentValve.java b/java/org/apache/catalina/valves/PersistentValve.java index 442cf10493..a3800ee492 100644 --- a/java/org/apache/catalina/valves/PersistentValve.java +++ b/java/org/apache/catalina/valves/PersistentValve.java @@ -267,7 +267,7 @@ public class PersistentValve extends ValveBase { * @throws IOException If an I/O error occurs while working with the request or response */ protected void onSemaphoreNotAcquired(Request request, Response response) throws IOException { - response.sendError(429); + response.sendError(HttpServletResponse.SC_TOO_MANY_REQUESTS); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
