acl req_mime_type mime-type1 ... regex match agains the mime type of the request generated by the client. Can be used to detect file upload or some types HTTP tunelling requests. NOTE: This does NOT match the reply. You cannot use this to match the returned file type. Index: squid/src/acl.c diff -u squid/src/acl.c:1.1.1.41 squid/src/acl.c:1.1.1.41.2.1 --- squid/src/acl.c:1.1.1.41 Sun Mar 5 11:33:39 2000 +++ squid/src/acl.c Sat Apr 22 11:07:01 2000 @@ -205,6 +205,8 @@ if (!strcmp(s, "arp")) return ACL_SRC_ARP; #endif + if (!strcmp(s, "req_mime_type")) + return ACL_REQ_MIME_TYPE; return ACL_NONE; } @@ -263,6 +265,8 @@ if (type == ACL_SRC_ARP) return "arp"; #endif + if (type == ACL_REQ_MIME_TYPE) + return "req_mime_type"; return "ERROR"; } @@ -743,6 +747,9 @@ aclParseArpList(&A->data); break; #endif + case ACL_REQ_MIME_TYPE: + aclParseWordList(&A->data); + break; case ACL_NONE: default: fatal("Bad ACL type"); @@ -1481,6 +1488,13 @@ case ACL_SRC_ARP: return aclMatchArp(&ae->data, checklist->src_addr); #endif + case ACL_REQ_MIME_TYPE: + header = httpHeaderGetStr(&checklist->request->header, + HDR_CONTENT_TYPE); + if (NULL == header) + header = ""; + return aclMatchRegex(ae->data, header); + /* NOTREACHED */ case ACL_NONE: default: debug(28, 0) ("aclMatchAcl: '%s' has bad type %d\n", Index: squid/src/cf.data.pre diff -u squid/src/cf.data.pre:1.1.1.43 squid/src/cf.data.pre:1.1.1.43.2.1 --- squid/src/cf.data.pre:1.1.1.43 Sun Mar 5 11:33:43 2000 +++ squid/src/cf.data.pre Sat Apr 22 11:07:03 2000 @@ -1647,10 +1647,17 @@ # This will be matched when the client's IP address has # more than HTTP connections established. + acl req_mime_type mime-type1 ... + # regex match agains the mime type of the request generated + # by the client. Can be used to detect file upload or some + # types HTTP tunelling requests. + # NOTE: This does NOT match the reply. You cannot use this + # to match the returned file type. Examples: acl myexample dst_as 1241 acl password proxy_auth REQUIRED +acl fileupload req_mime_type -i ^multipart/form-data$ Defaults: NOCOMMENT_START Index: squid/src/enums.h diff -u squid/src/enums.h:1.1.1.40 squid/src/enums.h:1.1.1.40.2.1 --- squid/src/enums.h:1.1.1.40 Sun Mar 5 11:33:50 2000 +++ squid/src/enums.h Sat Apr 22 11:07:03 2000 @@ -116,6 +116,7 @@ ACL_SNMP_COMMUNITY, ACL_NETDB_SRC_RTT, ACL_MAXCONN, + ACL_REQ_MIME_TYPE, ACL_ENUM_MAX } squid_acl;