This is a discussion on Re: [squid-users] request_body_max_size ? within the Squid Users forums, part of the Web Server and Related Forums category; On Mon, 26 Apr 2004, Michael Gale wrote: > Can I use "request_body_max_size" inside a acl ? There only ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Mon, 26 Apr 2004, Michael Gale wrote:
> Can I use "request_body_max_size" inside a acl ? There only is one single limit in this directive. But it is possible to invent a new acl for this using the external acl interface. request_body_max_size looks into the Content-Length request header, available to external_acl_type as %{Content-Length} This silly shell script should work #!/bin/sh while read line; do set -- $line length="$1" limit="$2" if [ "$length" -le "$2" ]; then echo OK else echo ERR fi done Use this as external_acl_type request_body %{Content-Length} /path/to/above/script acl request_max_20MB request_body 20971520 This acl can then be used in http_access to match requests up to the given size. If you need different sizes just define new acls with different limits in bytes (20971520 == 20480 * 1024 == 20480 KB) Regards Henrik |
![]() |
| Thread Tools | |
| Display Modes | |
|
|