From af27fb89403bf7517500600c957c7c82be1bca2f Mon Sep 17 00:00:00 2001 From: Ben Coombs Date: Wed, 6 Mar 2024 11:07:29 +0000 Subject: [PATCH] Enhance Status.java with Additional Standard HTTP Status Codes (#8444) * Update copyright and add new HTTP status codes - Updated copyright notice at the top of Status.java to reflect the current year. - Added HTTP status codes 203, 207, 507, 508, 510, and 511 with documentation links to respective RFCs. - Annotated newly introduced status codes with `@since 4.0.6` to mark their addition in this version. --- .../src/main/java/io/helidon/http/Status.java | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/http/http/src/main/java/io/helidon/http/Status.java b/http/http/src/main/java/io/helidon/http/Status.java index 66525c3b0e4..d9ef37f166c 100644 --- a/http/http/src/main/java/io/helidon/http/Status.java +++ b/http/http/src/main/java/io/helidon/http/Status.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,6 +56,14 @@ public class Status { * . */ public static final Status ACCEPTED_202 = new Status(202, "Accepted", true); + /** + * 203 Non-Authoritative Information, see + * HTTP/1.1 documentation. + * + * @since 4.0.6 + */ + public static final Status NON_AUTHORITATIVE_INFORMATION_203 = new Status(203, "Non-Authoritative Information", true); + /** * 204 No Content, see * HTTP/1.1 documentation. @@ -75,6 +83,13 @@ public class Status { * @since 2.0 */ public static final Status PARTIAL_CONTENT_206 = new Status(206, "Partial Content", true); + /** + * 207 Multi-Status, see + * RFC 4918 - HTTP Extensions for WebDAV. + * + * @since 4.0.6 + */ + public static final Status MULTI_STATUS_207 = new Status(207, "Multi-Status", true); /** * 301 Moved Permanently, see * HTTP/1.1 documentation. @@ -298,6 +313,37 @@ public class Status { * @since 3.0.3 */ public static final Status HTTP_VERSION_NOT_SUPPORTED_505 = new Status(505, "HTTP Version Not Supported", true); + /** + * 507 Insufficient Storage, see + * WebDAV documentation. + * + * @since 4.0.6 + */ + public static final Status INSUFFICIENT_STORAGE_507 = new Status(507, "Insufficient Storage", true); + /** + * 508 Loop Detected, see + * RFC 5842 - Bindings for the Constrained Application Protocol (CoAP). + * + * @since 4.0.6 + */ + public static final Status LOOP_DETECTED_508 = new Status(508, "Loop Detected", true); + + /** + * 510 Not Extended, see + * RFC 2774 - An HTTP Extension Framework. + * + * @since 4.0.6 + */ + public static final Status NOT_EXTENDED_510 = new Status(510, "Not Extended", true); + + /** + * 511 Network Authentication Required, see + * RFC 6585 - Additional HTTP Status Codes. + * + * @since 4.0.6 + */ + public static final Status NETWORK_AUTHENTICATION_REQUIRED_511 = new Status(511, "Network Authentication Required", true); + static { // THIS MUST BE AFTER THE LAST CONSTANT