]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
external_acl %PATH directive by Andrew Wansink <andrew@my-fortress.com>
authorhno <>
Wed, 21 Aug 2002 15:12:44 +0000 (15:12 +0000)
committerhno <>
Wed, 21 Aug 2002 15:12:44 +0000 (15:12 +0000)
src/cf.data.pre
src/external_acl.cc

index 3d4974f7f5517f1382f3e5aa90b68915b9cd198f..9bd73f3fe03280ef4263ef2cb5516f5ea068d125 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.275 2002/08/13 05:11:26 wessels Exp $
+# $Id: cf.data.pre,v 1.276 2002/08/21 09:12:44 hno Exp $
 #
 #
 # SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -1519,6 +1519,7 @@ DOC_START
          %DST          Requested host
          %PROTO        Requested protocol
          %PORT         Requested port
+         %PATH         Requested URL path
          %METHOD       Request method
          %{Header}     HTTP request header
          %{Hdr:member} HTTP request header list member
index a6c07c7c40067df66693171970657099312f12e9..ce2022f396ac9f4391283a2216e6a441f1902ed5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: external_acl.cc,v 1.6 2002/08/21 05:56:10 hno Exp $
+ * $Id: external_acl.cc,v 1.7 2002/08/21 09:12:44 hno Exp $
  *
  * DEBUG: section 82    External ACL
  * AUTHOR: Henrik Nordstrom, MARA Systems AB
@@ -101,6 +101,7 @@ struct _external_acl_format {
        EXT_ACL_DST,
        EXT_ACL_PROTO,
        EXT_ACL_PORT,
+       EXT_ACL_PATH,
        EXT_ACL_METHOD,
        EXT_ACL_HEADER,
        EXT_ACL_HEADER_MEMBER,
@@ -206,7 +207,7 @@ parse_externalAclHelper(external_acl ** list)
            char *header, *member, *end;
            header = token + 2;
            end = strchr(header, '}');
-           /* cut away the terminating } */
+           /* cut away the closing brace */
            if (end && strlen(end) == 1)
                *end = '\0';
            else
@@ -250,6 +251,8 @@ parse_externalAclHelper(external_acl ** list)
            format->type = EXT_ACL_PROTO;
        else if (strcmp(token, "%PORT") == 0)
            format->type = EXT_ACL_PORT;
+       else if (strcmp(token, "%PATH") == 0)
+           format->type = EXT_ACL_PATH;
        else if (strcmp(token, "%METHOD") == 0)
            format->type = EXT_ACL_METHOD;
        else {
@@ -516,6 +519,9 @@ makeExternalAclKey(aclCheck_t * ch, external_acl_data * acl_data)
            snprintf(buf, sizeof(buf), "%d", request->port);
            str = buf;
            break;
+       case EXT_ACL_PATH:
+           str = strStr(request->urlpath);
+           break;
        case EXT_ACL_METHOD:
            str = RequestMethodStr[request->method];
            break;