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 2020/11/30 20:35:32 UTC
[httpcomponents-core] branch 4.4.x updated: Add
HttpStatus.SC_TOO_MANY_REQUESTS 429 Too Many Requests (#233)
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch 4.4.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
The following commit(s) were added to refs/heads/4.4.x by this push:
new a400244 Add HttpStatus.SC_TOO_MANY_REQUESTS 429 Too Many Requests (#233)
a400244 is described below
commit a400244b11844f9704a9ef01c0fe75a684ca1516
Author: Artur Aukhatov <aa...@gmail.com>
AuthorDate: Mon Nov 30 23:35:23 2020 +0300
Add HttpStatus.SC_TOO_MANY_REQUESTS 429 Too Many Requests (#233)
---
httpcore/src/main/java/org/apache/http/HttpStatus.java | 2 ++
.../main/java/org/apache/http/impl/EnglishReasonPhraseCatalog.java | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/httpcore/src/main/java/org/apache/http/HttpStatus.java b/httpcore/src/main/java/org/apache/http/HttpStatus.java
index e8ccdc3..c555689 100644
--- a/httpcore/src/main/java/org/apache/http/HttpStatus.java
+++ b/httpcore/src/main/java/org/apache/http/HttpStatus.java
@@ -156,6 +156,8 @@ public interface HttpStatus {
int SC_LOCKED = 423;
/** {@code 424 Failed Dependency} (WebDAV - RFC 2518) */
int SC_FAILED_DEPENDENCY = 424;
+ /** {@code 429 Too Many Requests} (Additional HTTP Status Codes - RFC 6585) */
+ int SC_TOO_MANY_REQUESTS = 429;
// --- 5xx Server Error ---
diff --git a/httpcore/src/main/java/org/apache/http/impl/EnglishReasonPhraseCatalog.java b/httpcore/src/main/java/org/apache/http/impl/EnglishReasonPhraseCatalog.java
index 24b1b7b..5dfd0f8 100644
--- a/httpcore/src/main/java/org/apache/http/impl/EnglishReasonPhraseCatalog.java
+++ b/httpcore/src/main/java/org/apache/http/impl/EnglishReasonPhraseCatalog.java
@@ -93,7 +93,7 @@ public class EnglishReasonPhraseCatalog implements ReasonPhraseCatalog {
new String[3], // 1xx
new String[8], // 2xx
new String[8], // 3xx
- new String[25], // 4xx
+ new String[30], // 4xx
new String[8] // 5xx
};
@@ -140,6 +140,8 @@ public class EnglishReasonPhraseCatalog implements ReasonPhraseCatalog {
"Forbidden");
setReason(HttpStatus.SC_NOT_FOUND,
"Not Found");
+ setReason(HttpStatus.SC_TOO_MANY_REQUESTS,
+ "Too Many Requests");
setReason(HttpStatus.SC_INTERNAL_SERVER_ERROR,
"Internal Server Error");
setReason(HttpStatus.SC_NOT_IMPLEMENTED,