Re: 400 Error bad request

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 07 Nov 2011 13:04:58 -0700

On 11/07/2011 02:15 AM, Vikram Kumar wrote:

> I am getting the following error... "Error 400 Bad Request". for ICAP
> Reqmod message. Here's a snippet of the example ICAP client code..
>
>
>
> request ="GET http://www.foobar.com <http://www.foobar.com/>
> <http://www.foobar.com/>
> <http://www.foobar.com/>
> HTTP/1.1\r";
> output.println("REQMOD icap://" + server + ":" + "1344" + "/"+ "REQMOD" + "
> " + "1.0" +"\r");
> output.println("Host:" + server + ":" + port + "\")
> output.println("Encapsulated: req-hdr=0, null-body=" + length);
> output.println("Preview: 0\r");
> output.println("Allow: 204\r");
>
> output.println("\r");
> output.println(request);
> output.println("\r");
> Appreciate any help on this...this is a very simple ICAP client and i use
> the same format for sending ICAP options message and that works...for some
> reason REQMOD is getting rejected as bad request=8A

Hello Vikram,

    I recommend that you post questions about writing ICAP clients to
ICAP Forum as they are not related to Squid. If you repost your question
there, consider posting the actual headers (instead of the code that
produces them) and use plain text. You can collect the headers using
tcpdump, wireshark, server logs, etc.

I would also double check whether you are sending the protocol name
("ICAP") on the first request line, whether you want "\" on the Host:
header line, and whether you need an extra CRLF after the HTTP request.
However, please do not discuss those issues here. Instead, capture the
actual request, carefully compare with valid ICAP requests, and post any
questions to the ICAP Forum.

Good luck,

Alex.
Received on Mon Nov 07 2011 - 20:05:16 MST

This archive was generated by hypermail 2.2.0 : Tue Nov 08 2011 - 12:00:11 MST