From: Tim Duesterhus Date: Fri, 27 Apr 2018 19:18:46 +0000 (+0200) Subject: MINOR: http: Add support for 421 Misdirected Request X-Git-Tag: v1.9-dev1~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2b10bf491972d89c8385c623d6945b5cf7cedf6;p=thirdparty%2Fhaproxy.git MINOR: http: Add support for 421 Misdirected Request This makes haproxy aware of HTTP 421 Misdirected Request, which is defined in RFC 7540, section 9.1.2. --- diff --git a/include/types/proto_http.h b/include/types/proto_http.h index b7b7c6cbc1..5a6cc93129 100644 --- a/include/types/proto_http.h +++ b/include/types/proto_http.h @@ -197,6 +197,7 @@ enum { HTTP_ERR_403, HTTP_ERR_405, HTTP_ERR_408, + HTTP_ERR_421, HTTP_ERR_425, HTTP_ERR_429, HTTP_ERR_500, diff --git a/src/proto_http.c b/src/proto_http.c index f2a76823a5..345e889ba6 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -142,6 +142,7 @@ const int http_err_codes[HTTP_ERR_SIZE] = { [HTTP_ERR_403] = 403, [HTTP_ERR_405] = 405, [HTTP_ERR_408] = 408, + [HTTP_ERR_421] = 421, [HTTP_ERR_425] = 425, [HTTP_ERR_429] = 429, [HTTP_ERR_500] = 500, @@ -191,6 +192,14 @@ static const char *http_err_msgs[HTTP_ERR_SIZE] = { "\r\n" "

408 Request Time-out

\nYour browser didn't send a complete request in time.\n\n", + [HTTP_ERR_421] = + "HTTP/1.0 421 Misdirected Request\r\n" + "Cache-Control: no-cache\r\n" + "Connection: close\r\n" + "Content-Type: text/html\r\n" + "\r\n" + "

421 Misdirected Request

\nRequest sent to a non-authoritative server.\n\n", + [HTTP_ERR_425] = "HTTP/1.0 425 Too Early\r\n" "Cache-Control: no-cache\r\n" @@ -340,6 +349,7 @@ const char *get_reason(unsigned int status) case 416: return "Requested range unsatisfiable"; case 417: return "Expectation failed"; case 418: return "I'm a teapot"; + case 421: return "Misdirected Request"; case 422: return "Unprocessable entity"; case 423: return "Locked"; case 424: return "Method failure"; @@ -389,6 +399,7 @@ static const int http_get_status_idx(unsigned int status) case 403: return HTTP_ERR_403; case 405: return HTTP_ERR_405; case 408: return HTTP_ERR_408; + case 421: return HTTP_ERR_421; case 425: return HTTP_ERR_425; case 429: return HTTP_ERR_429; case 500: return HTTP_ERR_500;