<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 11.00.10570.1001"></HEAD>
<BODY>
<DIV><SPAN class=236144918-25062021><FONT size=2 face=Arial>Hello
all,</FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2 face=Arial>I'm trying to use
request headers in an external acl, and I'm probably doing it incorrectly, and
it's not working.</FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2 face=Arial>Here's my acl
definiton:</FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face="Courier New">external_acl_type ext_acl_program %SRC
%>{Connection} %>{Accept} %>{Custom_header} %>{Host}
/etc/squid/ext_acl_program.pl</FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2 face=Arial>The program
ext_acl_program.pl simply prints out the input</FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2 face=Arial><FONT
face="Courier New"> chomp ($line);<BR>
@fields = split(' ',
$line);<BR> my $ip
= $fields[0];<BR> my $connection =
$fields[1];<BR> my $accept =
$fields[2];<BR> my $custom =
$fields[3];<BR> my $host
= $fields[4];</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2 face="Courier New">
print LOGFILE "IP: $ip\n Conn: $connection\n Accept: $accept\n Custom:
$custom\n Host: $host";</FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face="Courier New"></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face="Courier New"> </FONT></DIV>
<DIV><SPAN class=236144918-25062021></SPAN><FONT size=2><FONT face=Arial>T<SPAN
class=236144918-25062021>he output looks like this:</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=236144918-25062021></SPAN></FONT> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2 face="Courier New">IP:
10.200.10.2<BR>Conn: keep-alive<BR>Accept: -<BR>Custom: -<BR>Host: </FONT><A
href="http://www.wsws.com:443"><FONT color=#000000 size=2
face="Courier New">www.wsws.com:443</FONT></A><BR></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV></SPAN><SPAN class=236144918-25062021><FONT size=2 face=Arial>As you see,
it has values for %SRC, %>{Connection} and %>{Host}. It does not
have values for %>{Accept} and %>{Custom_header}</FONT></SPAN></DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=236144918-25062021><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial>S<SPAN
class=236144918-25062021>o the question is, are these %>{} substitutions
coming from request_headers (as I thought)?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021>If yes, why does it only have Connection and Host,
and not Accept or my custom header?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021>If they are not coming from request headers, where are
they coming from?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021>And mostly, how can I pass my custom header into the
program?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021>Thanks so much for your
responses,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT size=2><FONT face=Arial><SPAN
class=236144918-25062021>Yosi</SPAN></FONT></FONT></FONT></DIV>
<DIV> </DIV></SPAN></BODY></HTML>