Skip to content

Commit

Permalink
Enhance Status.java with Additional Standard HTTP Status Codes (helid…
Browse files Browse the repository at this point in the history
…on-io#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.
  • Loading branch information
bjcoombs authored and hrstoyanov committed Mar 12, 2024
1 parent 89a1743 commit af27fb8
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion http/http/src/main/java/io/helidon/http/Status.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -56,6 +56,14 @@ public class Status {
* .
*/
public static final Status ACCEPTED_202 = new Status(202, "Accepted", true);
/**
* 203 Non-Authoritative Information, see
* <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.4">HTTP/1.1 documentation</a>.
*
* @since 4.0.6
*/
public static final Status NON_AUTHORITATIVE_INFORMATION_203 = new Status(203, "Non-Authoritative Information", true);

/**
* 204 No Content, see
* <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1 documentation</a>.
Expand All @@ -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
* <a href="https://www.rfc-editor.org/rfc/rfc4918.html#section-13">RFC 4918 - HTTP Extensions for WebDAV</a>.
*
* @since 4.0.6
*/
public static final Status MULTI_STATUS_207 = new Status(207, "Multi-Status", true);
/**
* 301 Moved Permanently, see
* <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1 documentation</a>.
Expand Down Expand Up @@ -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
* <a href="http://www.ietf.org/rfc/rfc4918.txt">WebDAV documentation</a>.
*
* @since 4.0.6
*/
public static final Status INSUFFICIENT_STORAGE_507 = new Status(507, "Insufficient Storage", true);
/**
* 508 Loop Detected, see
* <a href="https://www.rfc-editor.org/rfc/rfc5842#section-7.2">RFC 5842 - Bindings for the Constrained Application Protocol (CoAP)</a>.
*
* @since 4.0.6
*/
public static final Status LOOP_DETECTED_508 = new Status(508, "Loop Detected", true);

/**
* 510 Not Extended, see
* <a href="https://www.rfc-editor.org/rfc/rfc2774#section-7">RFC 2774 - An HTTP Extension Framework</a>.
*
* @since 4.0.6
*/
public static final Status NOT_EXTENDED_510 = new Status(510, "Not Extended", true);

/**
* 511 Network Authentication Required, see
* <a href="https://www.rfc-editor.org/rfc/rfc6585#section-6">RFC 6585 - Additional HTTP Status Codes</a>.
*
* @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
Expand Down

0 comments on commit af27fb8

Please sign in to comment.