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 633677591b4e028b2295cbb18c787445e7f8a960
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Mar 18 17:38:53 2026 +0000

    Add RFC 6585 status code (added in Servlet 6.2)
---
 java/jakarta/servlet/http/HttpServletResponse.java | 21 +++++++++++++++++++++
 webapps/docs/changelog.xml                         |  4 ++++
 2 files changed, 25 insertions(+)

diff --git a/java/jakarta/servlet/http/HttpServletResponse.java 
b/java/jakarta/servlet/http/HttpServletResponse.java
index 3256d2394a..58df63b4a3 100644
--- a/java/jakarta/servlet/http/HttpServletResponse.java
+++ b/java/jakarta/servlet/http/HttpServletResponse.java
@@ -623,6 +623,22 @@ public interface HttpServletResponse extends 
ServletResponse {
      */
     int SC_UPGRADE_REQUIRED = 426;
 
+    /**
+     * Status code (428) indicating that the origin server requires this 
request to be conditional.
+     */
+    int SC_PRECONDITION_REQUIRED = 428;
+
+    /**
+     * Status code (429) indicating that the user has sent too many requests 
in a given amount of time ("rate limiting").
+     */
+    int SC_TOO_MANY_REQUESTS = 429;
+
+    /**
+     * Status code (431) indicating that the server is unwilling to process 
the request because its header fields are too
+     * large.
+     */
+    int SC_REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
+
     /**
      * Status code (500) indicating an error inside the HTTP server which 
prevented it from fulfilling the request.
      */
@@ -655,4 +671,9 @@ public interface HttpServletResponse extends 
ServletResponse {
      * that was used in the request message.
      */
     int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
+
+    /**
+     * Status code (511) indicating that the client needs to authenticate to 
gain network access.
+     */
+    int SC_NETWORK_AUTHENTICATION_REQUIRED = 511;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ab94953c66..5068bccf63 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -185,6 +185,10 @@
         of <code>MessageDigestCredentialHandler</code> from <code>false</code>
         to <code>true</code>. (markt)
       </update>
+      <scode>
+        Add constants to <code>HttpServletResponse</code> for the HTTP status
+        codes defined in RFC 6585. (markt)
+      </scode>
       <!-- Entries for backport and removal before 12.0.0-M1 below this line 
-->
     </changelog>
   </subsection>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to