cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Prevent curl to trigger progressbar on 302 redirections

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 11 Jan 2013 09:15:52 +0100

On Fri, Jan 11, 2013 at 01:18:36AM +0100, Alexandre Filgueira wrote:
> I'm curious about this. The thing is that I'm using a redirector on my server
> (using Mirrorbrain) and when curl download a file from there it trigger the
> progressbar twice, downloading just bytes (I assume that it is the redirection)
> in the first one, and the proper file in the second one.
>
> My headers are big, because Mirrorbrain puts a lot of stuff there:
>
>
> [faidoc@Delorean ~]$ curl -sD- -o/dev/null http://mirrors.cinnarch.com/
> cinnarch-core/x86_64/cinnarch-keyring-20120717-3-any.pkg.tar.xz
> HTTP/1.1 302 Found
> Date: Fri, 11 Jan 2013 00:14:12 GMT
> Server: Apache/2.2.16 (Debian)
> X-MirrorBrain-Mirror: softlibre.unizar.es
[...]
> Content-Length: 369

My guess this is the difference. The one redirect has a body, and the
other doesn't:

> [faidoc@Delorean ~]$ curl -sD- -o/dev/null https://www.archlinux.org/
> packages/extra/i686/aalib/download/
> HTTP/1.1 302 FOUND
> Date: Fri, 11 Jan 2013 00:14:50 GMT
> Server: Apache
> X-Frame-Options: DENY
> Content-Length: 0

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-11