]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2225 fix: method CONNECT acl wrongly applied to method GET
authorrousskov <>
Sat, 16 Feb 2008 00:26:00 +0000 (00:26 +0000)
committerrousskov <>
Sat, 16 Feb 2008 00:26:00 +0000 (00:26 +0000)
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.

src/HttpRequestMethod.h

index 1f8aa6fd9eb398de8dd48ba68ae3aff0a0010943..1eaf9aebdf95e64719235760788d5309638bb5d7 100644 (file)
@@ -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; }