Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Status.java with Additional Standard HTTP Status Codes #8444

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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