You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2018/09/08 17:41:00 UTC

httpcomponents-core git commit: HTTPCORE-557-add http status code 506

Repository: httpcomponents-core
Updated Branches:
  refs/heads/master 5da050c2b -> 107951737


HTTPCORE-557-add http status code 506


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/10795173
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/10795173
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/10795173

Branch: refs/heads/master
Commit: 107951737a3b26c30d38be850d22956a577ca42e
Parents: 5da050c
Author: sparsick <sp...@web.de>
Authored: Sat Sep 8 11:58:33 2018 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat Sep 8 19:38:23 2018 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/hc/core5/http/HttpStatus.java    | 10 +++++++---
 .../hc/core5/http/impl/EnglishReasonPhraseCatalog.java    |  3 +++
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/10795173/httpcore5/src/main/java/org/apache/hc/core5/http/HttpStatus.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/HttpStatus.java b/httpcore5/src/main/java/org/apache/hc/core5/http/HttpStatus.java
index 94c74be..b145908 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/HttpStatus.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/HttpStatus.java
@@ -30,8 +30,10 @@ package org.apache.hc.core5.http;
 /**
  * Constants enumerating the HTTP status codes.
  * All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1),
- * RFC2518 (WebDAV), RFC7540 (HTTP/2), RFC7725 (An HTTP Status Code to Report Legal Obstacles)
- * and RFC6585 (Additional HTTP Status Codes) are listed.
+ * RFC2518 (WebDAV), RFC7540 (HTTP/2), RFC6585 (Additional HTTP Status Codes)
+ * RFC8297 (Early Hints), RFC7538 (Permanent Redirect), RFC7725 (An HTTP Status
+ * Code to Report Legal Obstacles) and RFC2295 (Transparent Content Negotiation)
+ * are listed.
  *
  * @see <a href="https://tools.ietf.org/html/rfc1945">RFC1945 (HTTP/1.0)</a>
  * @see <a href="https://tools.ietf.org/html/rfc2616">RFC2616 (HTTP/1.1)</a>
@@ -41,6 +43,7 @@ package org.apache.hc.core5.http;
  * @see <a href="https://tools.ietf.org/html/rfc8297">RFC8297 (Early Hints)</a>
  * @see <a href="https://tools.ietf.org/html/rfc7538">RFC7538 (Permanent Redirect)</a>
  * @see <a href="https://tools.ietf.org/html/rfc7725">RFC7725 (An HTTP Status Code to Report Legal Obstacles)</a>
+ * @see <a href="https://tools.ietf.org/html/rfc2295">RFC2295 (Transparent Content Negotiation)</a>
  * @since 4.0
  */
 public interface HttpStatus {
@@ -206,7 +209,8 @@ public interface HttpStatus {
     int SC_GATEWAY_TIMEOUT = 504;
     /** {@code 505 HTTP Version Not Supported} (HTTP/1.1 - RFC 2616) */
     int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
-
+    /** {@code 506 Variant Also Negotiates} ( Transparent Content Negotiation - RFC2295) */
+    int SC_VARIANT_ALSO_NEGOTIATES = 506;
     /** {@code 507 Insufficient Storage} (WebDAV - RFC 2518) */
     int SC_INSUFFICIENT_STORAGE = 507;
 

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/10795173/httpcore5/src/main/java/org/apache/hc/core5/http/impl/EnglishReasonPhraseCatalog.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/EnglishReasonPhraseCatalog.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/EnglishReasonPhraseCatalog.java
index 6798a78..3d7d2a1 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/EnglishReasonPhraseCatalog.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/EnglishReasonPhraseCatalog.java
@@ -247,6 +247,9 @@ public class EnglishReasonPhraseCatalog implements ReasonPhraseCatalog {
         // Legal Obstacles - see RFC 7725
         setReason(HttpStatus.SC_UNAVAILABLE_FOR_LEGAL_REASONS,
                 "Unavailable For Legal Reasons");
+        // Transparent Content Negotiation - see RFC 2295
+        setReason(HttpStatus.SC_VARIANT_ALSO_NEGOTIATES,
+                "Variant Also Negotiates");
     }