Re: ICAP REQMOD handling of 200 Ok response

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Tue, 11 Jan 2011 18:01:49 -0700

On 01/10/2011 04:01 PM, sichent wrote:
>
> Please correct me if I am wrong... as of the latest stable version of
> Squid 3.1.10 it is *NOT* possible to give Squid back the adapted HTTP
> request with ICAP/1.0 200 Ok reply from ICAP server?

It is possible.

> Well, what I see in ModXAct.cc(789) the 200 Ok response coming from ICAP
> server MUST have an encapsulated HTTP response headers... but actually
> when we adapt the HTTP request we may just have tweaked for example some
> of its parameters... say URL or Cookie or whatever... leaving everything
> other intact.

Using REQMOD, you can tweak almost any aspect of the HTTP request,
including request headers and request body, if any. If you do, you must
send the complete adapted request back to Squid using an ICAP 200 OK
response.

> Does it mean that it is a bug of Squid or just that I overlooked something?

> bool Adaptation::Icap::ModXact::validate200Ok()
> {
> ... skipped ...
>
> if (ICAP::methodReqmod == service().cfg().method) {
> if (!gotEncapsulated("res-hdr") && !gotEncapsulated("req-hdr"))
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> return false;

This reads "for REQMOD, if there are no encapsulated response headers
and no encapsulated request headers, then return false because it is an
invalid ICAP 200 OK response".

HTH,

Alex.
Received on Wed Jan 12 2011 - 01:02:06 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 12 2011 - 12:00:04 MST