MINOR: http: Mark the 425 code as "Too Early".
This adds a new status code for use with the "http-request deny" ruleset.
The use case for this code is currently handled by this draft dedicated
to 0-RTT processing :
https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-replay
diff --git a/doc/configuration.txt b/doc/configuration.txt
index bba695a..5a8c8b5 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -3154,8 +3154,8 @@
yes | yes | yes | yes
Arguments :
<code> is the HTTP status code. Currently, HAProxy is capable of
- generating codes 200, 400, 403, 405, 408, 429, 500, 502, 503, and
- 504.
+ generating codes 200, 400, 403, 405, 408, 425, 429, 500, 502,
+ 503, and 504.
<file> designates a file containing the full HTTP response. It is
recommended to follow the common practice of appending ".http" to
@@ -3203,8 +3203,8 @@
yes | yes | yes | yes
Arguments :
<code> is the HTTP status code. Currently, HAProxy is capable of
- generating codes 200, 400, 403, 405, 408, 429, 500, 502, 503, and
- 504.
+ generating codes 200, 400, 403, 405, 408, 425, 429, 500, 502,
+ 503, and 504.
<url> it is the exact contents of the "Location" header. It may contain
either a relative URI to an error page hosted on the same site,
@@ -3235,8 +3235,8 @@
yes | yes | yes | yes
Arguments :
<code> is the HTTP status code. Currently, HAProxy is capable of
- generating codes 200, 400, 403, 405, 408, 429, 500, 502, 503, and
- 504.
+ generating codes 200, 400, 403, 405, 408, 425, 429, 500, 502,
+ 503, and 504.
<url> it is the exact contents of the "Location" header. It may contain
either a relative URI to an error page hosted on the same site,
diff --git a/include/types/proto_http.h b/include/types/proto_http.h
index 027bfce..cf0fdb6 100644
--- a/include/types/proto_http.h
+++ b/include/types/proto_http.h
@@ -196,6 +196,7 @@
HTTP_ERR_403,
HTTP_ERR_405,
HTTP_ERR_408,
+ HTTP_ERR_425,
HTTP_ERR_429,
HTTP_ERR_500,
HTTP_ERR_502,
diff --git a/src/proto_http.c b/src/proto_http.c
index c81409f..939a7a1 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -140,6 +140,7 @@
[HTTP_ERR_403] = 403,
[HTTP_ERR_405] = 405,
[HTTP_ERR_408] = 408,
+ [HTTP_ERR_425] = 425,
[HTTP_ERR_429] = 429,
[HTTP_ERR_500] = 500,
[HTTP_ERR_502] = 502,
@@ -188,6 +189,14 @@
"\r\n"
"<html><body><h1>408 Request Time-out</h1>\nYour browser didn't send a complete request in time.\n</body></html>\n",
+ [HTTP_ERR_425] =
+ "HTTP/1.0 425 Too Early\r\n"
+ "Cache-Control: no-cache\r\n"
+ "Connection: close\r\n"
+ "Content-Type: text/html\r\n"
+ "\r\n"
+ "<html><body><h1>425 Too Early</h1>\nYour browser sent early data.\n</body></html>\n",
+
[HTTP_ERR_429] =
"HTTP/1.0 429 Too Many Requests\r\n"
"Cache-Control: no-cache\r\n"
@@ -332,7 +341,7 @@
case 422: return "Unprocessable entity";
case 423: return "Locked";
case 424: return "Method failure";
- case 425: return "Unordered Collection";
+ case 425: return "Too Early";
case 426: return "Upgrade Required";
case 428: return "Precondition Required";
case 429: return "Too Many Requests";
@@ -378,6 +387,7 @@
case 403: return HTTP_ERR_403;
case 405: return HTTP_ERR_405;
case 408: return HTTP_ERR_408;
+ case 425: return HTTP_ERR_425;
case 429: return HTTP_ERR_429;
case 500: return HTTP_ERR_500;
case 502: return HTTP_ERR_502;