[squid-users] How to use request headers in external_acl_type

Yosi Greenfield ygreenfield at kewsystems.com
Fri Jun 25 19:18:40 UTC 2021


Hello all,
 
I'm trying to use request headers in an external acl, and I'm probably doing
it incorrectly, and it's not working.
 
Here's my acl definiton:
 
external_acl_type ext_acl_program  %SRC %>{Connection} %>{Accept}
%>{Custom_header} %>{Host} /etc/squid/ext_acl_program.pl
 
 
The program ext_acl_program.pl simply prints out the input
 
   chomp ($line);
   @fields          = split(' ', $line);
   my $ip           = $fields[0];
   my $connection   = $fields[1];
   my $accept       = $fields[2];
   my $custom       = $fields[3];
   my $host         = $fields[4];
 
   print LOGFILE  "IP: $ip\n Conn: $connection\n Accept: $accept\n Custom:
$custom\n Host: $host";
 
     
The output looks like this:
 
IP: 10.200.10.2
Conn: keep-alive
Accept: -
Custom: -
Host:  <http://www.wsws.com:443> www.wsws.com:443

 
As you see, it has values for %SRC, %>{Connection} and %>{Host}.  It does
not have values for %>{Accept} and %>{Custom_header}
 
 
So the question is, are these %>{} substitutions coming from request_headers
(as I thought)?
 
If yes, why does it only have Connection and Host, and not Accept or my
custom header?
 
If they are not coming from request headers, where are they coming from?
 
And mostly, how can I pass my custom header into the program?
 
Thanks so much for your responses,
Yosi
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20210625/af5e0b21/attachment.htm>


More information about the squid-users mailing list