cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Host: header

From: Jamie Lokier <jamie_at_shareable.org>
Date: Tue, 24 Aug 2004 17:58:21 +0100

Roman Koifman wrote:
> When a server receives the request the host is not given in the GET line.
> the GET looks like :
>
> GET /path HTTP/1.1
> Host: hostname.
>
> The GET line contains the host only in the proxy requests.

Correct.

Nonethless, HTTP/1.1 origin servers are required to accept the form
with the host in the GET line (i.e. a full URI), and to ignore the
value of the Host header in that case.

In the example which started this thread, libcurl is sending a full
URI in the GET line and also sending a Host header, with the wrong
Host header values in all but the first request.

I presume libcurl was configured to talk with a proxy for that
example. If libcurl is sending a full URI to an origin server, that's
a second bug in libcurl (the first is the wrong Host header values).

When talking to a proxy, RFC 2616 requires that the client still sends
a Host header even though the host is given in the GET line.

-- Jamie
Received on 2004-08-24