On 09/03/2013 04:37 AM, Norbert Naveen wrote:
> Hello ,
>    There is possibility of adding a new HTTP header via
>     Usage:   request_header_add field-name field-value acl1 [acl2] ...
>     Example: request_header_add X-Client-CA "CA=%ssl::>cert_issuer" all
> 
>    Wanted to know if the HTTP header value can be dynamic ?

Yes, the example you quoted already contains a dynamic header value
(HTTP client certificate issuer).


> and can
> invoke a program to fetch the Value dynamically and populate?


Yes, with recent Squids, you can dynamically set annotations and then
use %note macro to add those annotations to HTTP request headers.
Annotations can be set using an eCAP adapter, a url_rewrite_program or,
IIRC, an external ACL. Here is a sketch:

  url_rewrite_program /this/helper/replies/with OK note1=dynamicValue
  acl hasNote1 note note1
  request_header_add X-Note1 "%{note1}note" hasNote1


HTH,

Alex.

Reply via email to