From: Amos Jeffries Date: Tue, 16 Aug 2011 08:13:38 +0000 (+1200) Subject: Add special case for CONNECT request Host: verify X-Git-Tag: take08~43^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65d2fdbf85667878d63de3b6bebe9d342d271aee;p=thirdparty%2Fsquid.git Add special case for CONNECT request Host: verify --- diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 9de7ec0d3b..05d512c5c4 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -638,8 +638,9 @@ ClientRequestContext::hostHeaderVerify() // Verify forward-proxy requested URL domain matches the Host: header debugs(85, 3, HERE << "FAIL on validate URL port " << http->request->port << " matches Host: port " << portStr); hostHeaderVerifyFailed("URL port", portStr); - } else if (!portStr && http->request->port != urlDefaultPort(http->request->protocol)) { + } else if (!portStr && http->request->method != METHOD_CONNECT && http->request->port != urlDefaultPort(http->request->protocol)) { // Verify forward-proxy requested URL domain matches the Host: header + // Special case: we don't have a default-port to check for CONNECT. Assume URL is correct. debugs(85, 3, HERE << "FAIL on validate URL port " << http->request->port << " matches Host: default port " << urlDefaultPort(http->request->protocol)); hostHeaderVerifyFailed("URL port", "default port"); } else {