Re: [squid-users] request_body_max_size ?

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Squid Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-26-2004
Henrik Nordstrom
 
Posts: n/a
Default Re: [squid-users] request_body_max_size ?

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


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:07 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0