From: rousskov <> Date: Sat, 16 Feb 2008 00:26:00 +0000 (+0000) Subject: Bug 2225 fix: method CONNECT acl wrongly applied to method GET X-Git-Tag: BASIC_TPROXY4~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25c48de23cb5e7c1d4a04763cebe4460b70629fa;p=thirdparty%2Fsquid.git Bug 2225 fix: method CONNECT acl wrongly applied to method GET The method comparison operator was broken for all methods other than "other". I did not check whether we need to do case-insensitive compare of method strings when the method is "other". We have to if Squid does not convert all unknown methods to uppercase. --- diff --git a/src/HttpRequestMethod.h b/src/HttpRequestMethod.h index 1f8aa6fd9e..1eaf9aebdf 100644 --- a/src/HttpRequestMethod.h +++ b/src/HttpRequestMethod.h @@ -1,5 +1,5 @@ /* - * $Id: HttpRequestMethod.h,v 1.9 2008/02/12 00:05:11 amosjeffries Exp $ + * $Id: HttpRequestMethod.h,v 1.10 2008/02/15 17:26:00 rousskov Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -118,13 +118,14 @@ public: bool operator == (_method_t const & aMethod) const { return theMethod == aMethod; } bool operator == (HttpRequestMethod const & aMethod) const { - return ( (theMethod == aMethod.theMethod) || (theImage == aMethod.theImage) ); + return theMethod == aMethod.theMethod && + (theMethod != METHOD_OTHER || theImage == aMethod.theImage); } bool operator != (_method_t const & aMethod) const { return theMethod != aMethod; } bool operator != (HttpRequestMethod const & aMethod) const { - return ( (theMethod != aMethod.theMethod) || (theImage != aMethod.theImage) ); + return !operator==(aMethod); } /** Iterate through the registered HTTP methods. */ @@ -142,7 +143,7 @@ public: /** Get an ID representation of the method. \retval METHOD_NONE the methopd is currently unset or unknown. - \retval METHOD_UNKNOWN the method has been accepted but is not one of the registerd HTTP methods. + \retval METHOD_OTHER the method has been accepted but is not one of the registerd HTTP methods. \retval * the method is on of the registered HTTP methods. */ _method_t const id() const { return theMethod; }