From: hno <> Date: Mon, 24 Jun 2002 12:07:38 +0000 (+0000) Subject: Deny any requests using transfer-encoding. This is needed in case a browser X-Git-Tag: SQUID_3_0_PRE1~949 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5affedf3029386f1b9c97911e85652480257fbb1;p=thirdparty%2Fsquid.git Deny any requests using transfer-encoding. This is needed in case a browser gets confused and sends us a HTTP/1.1 request using transfer-encoding. --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index b91b1bb6d4..cc746fa978 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.cc,v 1.78 2002/06/16 20:10:29 hno Exp $ + * $Id: HttpHeader.cc,v 1.79 2002/06/24 06:07:38 hno Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -112,6 +112,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] = {"Server", HDR_SERVER, ftStr}, {"Set-Cookie", HDR_SET_COOKIE, ftStr}, {"Title", HDR_TITLE, ftStr}, + {"Transfer-Encoding", HDR_TRANSFER_ENCODING, ftStr}, {"Upgrade", HDR_UPGRADE, ftStr}, /* for now */ {"User-Agent", HDR_USER_AGENT, ftStr}, {"Vary", HDR_VARY, ftStr}, /* for now */ @@ -149,7 +150,7 @@ static http_hdr_type ListHeadersArr[] = HDR_IF_MATCH, HDR_IF_NONE_MATCH, HDR_LINK, HDR_PRAGMA, HDR_PROXY_CONNECTION, - /* HDR_TRANSFER_ENCODING, */ + HDR_TRANSFER_ENCODING, HDR_UPGRADE, HDR_VARY, HDR_VIA, @@ -168,7 +169,7 @@ static http_hdr_type ListHeadersArr[] = static http_hdr_type GeneralHeadersArr[] = { HDR_CACHE_CONTROL, HDR_CONNECTION, HDR_DATE, HDR_PRAGMA, - /* HDR_TRANSFER_ENCODING, */ + HDR_TRANSFER_ENCODING, HDR_UPGRADE, /* HDR_TRAILER, */ HDR_VIA diff --git a/src/client_side.cc b/src/client_side.cc index 0880368a6b..7f6e53cfab 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.580 2002/06/14 18:45:16 hno Exp $ + * $Id: client_side.cc,v 1.581 2002/06/24 06:07:38 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2581,7 +2581,8 @@ clientReadRequest(int fd, void *data) request->my_addr = conn->me.sin_addr; request->my_port = ntohs(conn->me.sin_port); request->http_ver = http->http_ver; - if (!urlCheckRequest(request)) { + if (!urlCheckRequest(request) || + httpHeaderHas(&request->header, HDR_TRANSFER_ENCODING)) { err = errorCon(ERR_UNSUP_REQ, HTTP_NOT_IMPLEMENTED); err->src_addr = conn->peer.sin_addr; err->request = requestLink(request); diff --git a/src/enums.h b/src/enums.h index 76e56e5a87..83666b80c0 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.208 2002/06/23 13:32:24 hno Exp $ + * $Id: enums.h,v 1.209 2002/06/24 06:07:38 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -229,6 +229,7 @@ typedef enum { HDR_SERVER, HDR_SET_COOKIE, HDR_TITLE, + HDR_TRANSFER_ENCODING, HDR_UPGRADE, HDR_USER_AGENT, HDR_VARY,