>
> That should be pretty trivial to accomplish.
>
> To answer your question of passing data: use notes:
>
> $filter->r->note->set(transform => 1);
>
> if you work with the connection level filter you will need to use:
>
> $filter->c->note->set(transform => 1);
>
> though remember that this note will be seen through the
> connection, i.e. for
> all requests coming over the same connection.
>
> However I believe there is a much simpler solution:
>
> add a connection level filter similar to this one:
> http://perl.apache.org/docs/2.0/user/handlers/filters.html#Con
> nection_Input_Filters
> rewrite the request (URI) line to strip your magic argument and add a
> new
> header, like:
> X-Chris-Transform: On
> after the request line (well may be you need to do it after the Host:
> header,
> I'm not sure whether the server expects the Host: header second).
>
> Now your request level filter can lookup this header:
>
> $filter->r->headers_in->get('X-Chris-Transform');
>
> as simple as that.
Thanks for this.
I get errors when I try and use notes. Exact error is:
Can't locate object method "note" via package "Apache::Connection"....
I have got a line reading "use Apache::Connection();" at the top of my
code :)
I prefer the second method, however I'm having some problems with it. If
I add the header in the request filter, it doesn't appear to be set when
I do
$filter->r->headers_in->get("X-iProxy");
The returned result is empty.
If I telnet into the proxy and type the request manually, with the
header there, it works fine.
It's definitly adding the header in the request filter, but I can't
retrieve it through the headers_in function. It only works when the
client sends the "X-iProxy" header, not when it's added via the filter.
Any ideas?
---
Regards,
Chris Pringle
UK PSG
Hewlett-Packard, Bristol
Tel: 0117 31 29664
Mob: 07752 307063