]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla #463: GET requests with request entity fail
authorhno <>
Fri, 15 Nov 2002 20:12:36 +0000 (20:12 +0000)
committerhno <>
Fri, 15 Nov 2002 20:12:36 +0000 (20:12 +0000)
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
src/client_side.cc
src/structs.h

index 89625b39e60826a327db92e0f4a23bb451f938a9..704f5ff4d31f84ccc2cadec6704c6ec1aeec1f05 100644 (file)
@@ -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)
index cdcde6110e9d4b10ea0e5340041fcbbfb1c41946..8235efe70bbba499a0c254571cc50e7f6ad9dd4a 100644 (file)
@@ -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;
index ea3347a23d20b44a62f9e5669c3abe6a9b9b89b3..7563596a842ecf870fa00a9c1551a0e0faf95be0 100644 (file)
@@ -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;