Hi,

On Wed, Jan 07, 2009 at 10:46:47AM +0100, Vlastimil Holer wrote:
> Hi, 
> 
> I need to add custom header into requests with some information about
> currently processing request. I'm looking at reqadd parameter, but
> the string looks like a static text. I would need something like that:
> 
>     reqadd X-Original-URL:\ $HTTP_URL_ABS
> 
> Now the header is added as is written.

we can't do that right now, because a lot of work remains to be done
on header processing to be able to extract some values and use them
somewhere else.

However, I've already had to do something like this, and the way I did
it was horrible but it worked. The solution consists in replacing the
request line with itself followed by a header. You cut the line into
fields using a regex, and that way you're able to reuse the url field
in the header. Something approximately like this (from memories, might
need some tweaking) :

     reqrep ^([^\ ]*)\ ([^\ ]*)\ (HTTP.*)  \0\r\nX-Original-URL:\ \2

I know this is a bit tricky, but if it can help until there is a better
solution, that's fine.

Regards,
Willy


Reply via email to