From 813e5da197d57aaba7ebe5480e6031d48c2a3563 Mon Sep 17 00:00:00 2001 From: hno <> Date: Fri, 15 Nov 2002 20:12:36 +0000 Subject: [PATCH] Bugzilla #463: GET requests with request entity fail This patch adds a new squid.conf directive "request_entities on/off". If set to "on" then Squid will allow GET/HEAD requests with request entities, even if such entites are "undefined" in the HTTP specification. Technically speaking Squid is violating the HTTP specification when not allowing such requests. The official way to handle such requests is that the server should ignore the request entity. --- src/cf.data.pre | 15 ++++++++++++++- src/client_side.cc | 4 ++-- src/structs.h | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/cf.data.pre b/src/cf.data.pre index 89625b39e6..704f5ff4d3 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.290 2002/10/13 20:34:59 robertc Exp $ +# $Id: cf.data.pre,v 1.291 2002/11/15 13:12:36 hno Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -3826,6 +3826,19 @@ DOC_START You can add up to 20 additional "extension" methods here. DOC_END +NAME: request_entities +TYPE: onoff +LOC: Config.onoff.request_entities +DEFAULT: off +DOC_START + Squid defaults to deny GET and HEAD requests with request entities, + as the meaning of such requests are undefined in the HTTP standard + even if not explicitly forbidden. + + Set this directive to on if you have clients which insists + on sending request entities in GET or HEAD requests. +DOC_END + NAME: high_response_time_warning TYPE: int COMMENT: (msec) diff --git a/src/client_side.cc b/src/client_side.cc index cdcde6110e..8235efe70b 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.607 2002/11/10 04:23:08 hno Exp $ + * $Id: client_side.cc,v 1.608 2002/11/15 13:12:36 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -538,7 +538,7 @@ clientIsContentLengthValid(request_t * r) case METHOD_GET: case METHOD_HEAD: /* We do not want to see a request entity on GET/HEAD requests */ - return (r->content_length <= 0); + return (r->content_length <= 0 || Config.onoff.request_entities); default: /* For other types of requests we don't care */ return 1; diff --git a/src/structs.h b/src/structs.h index ea3347a23d..7563596a84 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.437 2002/10/25 07:37:00 robertc Exp $ + * $Id: structs.h,v 1.438 2002/11/15 13:12:36 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -498,6 +498,7 @@ struct _SquidConfig { int ie_refresh; int vary_ignore_expire; int pipeline_prefetch; + int request_entities; int check_hostnames; int via; int emailErrData; -- 2.47.3