From: Amos Jeffries Date: Mon, 8 Dec 2014 12:05:17 +0000 (-0800) Subject: HTTP/2: Support 421 (Misdirected Request) status code X-Git-Tag: SQUID_3_4_10~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2202660b2b3f17f2dde3cdd05d99cd121ddb165d;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 0e6eb0c8c6..33caadc2b5 100644 --- a/src/http.cc +++ b/src/http.cc @@ -528,6 +528,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 854492ba4b..771c95ce91 100644 --- a/src/http/StatusCode.cc +++ b/src/http/StatusCode.cc @@ -172,6 +172,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 349b1ed82a..228241db92 100644 --- a/src/http/StatusCode.h +++ b/src/http/StatusCode.h @@ -50,6 +50,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 */