cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] --ignore-content-length

From: Toby Peterson <toby_at_opendarwin.org>
Date: Wed, 24 Aug 2005 13:38:05 -0700

On Aug 24, 2005, at 1:22 PM, Jamie Lokier wrote:

> Toby Peterson wrote:
>
>
>> It's not enabled by default - the user must explicitly specify it, as
>> there is no way (that I can see) to automatically determine that the
>> server is stupid. Can't trust the Server header these days...
>>
>>
>
> Does the server always send "Connection: close" when it's sending a
> file with broken Content-Length like this?
>
> If so, you could always ignore the Content-Length header on responses
> which have "Connection: close" and no Transfer-Encoding - or even
> better, accept additional data but complain if there's not enough
> data.
>

Nope, here's the headers I get for a 4.2 GB file:

HTTP/1.1 200 OK
Date: Wed, 24 Aug 2005 20:36:52 GMT
Server: Apache/1.3.33 (Darwin)
Last-Modified: Tue, 23 Aug 2005 20:58:37 GMT
ETag: "38-bf6f000-430b8dfd"
Accept-Ranges: bytes
Content-Length: 200732672
Content-Type: text/plain

- Toby
Received on 2005-08-24