Re: [squid-users] Dynamic HTTP Header Addition

From: Norbert Naveen <norbert.naveen_at_tayana.in>
Date: Wed, 4 Sep 2013 09:16:42 +0530

Hello Alex ,
    Thank you very much , shall try this and confirm
Rgds

-----Original Message-----
From: Alex Rousskov
Sent: Tuesday, September 03, 2013 8:45 PM
To: squid-users_at_squid-cache.org
Subject: Re: [squid-users] Dynamic HTTP Header Addition

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.
Received on Wed Sep 04 2013 - 03:47:09 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 04 2013 - 12:00:05 MDT