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:40 UTC
httpcomponents-core git commit: HTTPCORE-557: add http status code
506 [Forced Update!]
Repository: httpcomponents-core
Updated Branches:
refs/heads/master 107951737 -> 95bb2e754 (forced update)
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/95bb2e75
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/95bb2e75
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/95bb2e75
Branch: refs/heads/master
Commit: 95bb2e754c736884b206db77450cfab26fa08928
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:41:19 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/95bb2e75/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/95bb2e75/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");
}