From: Amos Jeffries Date: Wed, 3 Dec 2014 15:13:08 +0000 (-0800) Subject: HTTP/2: Support 421 (Misdirected Request) status code X-Git-Tag: merge-candidate-3-v1~463 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe3f89770a452afed022f43d11c78fce75cebff1;p=thirdparty%2Fsquid.git HTTP/2: Support 421 (Misdirected Request) status code Add support for status 421 responses. Squid is forbidden from generating messages with this status in its role as proxy, however we expect to see it being produced in responses by HTTP/2 servers in traffic from HTTP 2.0<->1.1 gateways. We also MAY emit it on future reverse-proxy responses in the event of a ERR_CANNOT_FORWARD message. --- diff --git a/src/http.cc b/src/http.cc index 2509a88eab..f776d9e565 100644 --- a/src/http.cc +++ b/src/http.cc @@ -517,6 +517,8 @@ HttpStateData::cacheableReply() case Http::scServiceUnavailable: case Http::scGatewayTimeout: + case Http::scMisdirectedRequest: + debugs(22, 3, "MAYBE because HTTP status " << rep->sline.status()); return -1; diff --git a/src/http/StatusCode.cc b/src/http/StatusCode.cc index 56cdeed0dd..2bea66beaa 100644 --- a/src/http/StatusCode.cc +++ b/src/http/StatusCode.cc @@ -180,6 +180,10 @@ Http::StatusCodeString(const Http::StatusCode status) return "Expectation Failed"; break; + case Http::scMisdirectedRequest: + return "Misdirected Request"; + break; + case Http::scUnprocessableEntity: return "Unprocessable Entity"; break; diff --git a/src/http/StatusCode.h b/src/http/StatusCode.h index e476fe64ab..88fe7cf688 100644 --- a/src/http/StatusCode.h +++ b/src/http/StatusCode.h @@ -58,6 +58,7 @@ typedef enum { scUnsupportedMediaType = 415, scRequestedRangeNotSatisfied = 416, scExpectationFailed = 417, + scMisdirectedRequest = 421, /**< draft-ietf-httpbis-http2-16 section 9.1.2 */ scUnprocessableEntity = 422, /**< RFC2518 section 10.3 / RFC4918 */ scLocked = 423, /**< RFC2518 section 10.4 / RFC4918 */ scFailedDependency = 424, /**< RFC2518 section 10.5 / RFC4918 */