curl-users
Re: --include and --head - option order is important
Date: Sun, 13 Apr 2008 22:23:01 -0500
On Sun, Apr 13, 2008 at 10:13 PM, Brock Noland <brockn_at_gmail.com> wrote:
> Greetings,
>
> It appears as though when using -i and -I, you must specify -i after -I.
>
> $ curl -I -i http://bashcurescancer.com
> $ curl -i -I http://bashcurescancer.com
> HTTP/1.1 200 OK
> Date: Mon, 14 Apr 2008 03:11:35 GMT
> Server: Apache/2.2.6 (Unix)
> X-Pingback: http://bashcurescancer.com/wordpress/xmlrpc.php
> Last-Modified: Mon, 14 Apr 2008 02:38:11 GMT
> Connection: close
> Content-Type: text/html; charset=UTF-8
>
> I tested this with the latest version, curl-7.18.1 and confirmed this
> situation still exists. I don't see anything in the manual about these
> options having a required order (though I could have missed
> something).
>
> If this is indeed a bug, the fix, below, is trivial.
>
> Thanks for you time,
> Brock Noland
>
> --- main.old.c 2008-04-13 16:10:49.000000000 -0500
> +++ main.c 2008-04-13 16:13:32.000000000 -0500
> @@ -2445,6 +2445,7 @@
> return err;
> break;
> case 'i':
> + if(CONF_HEADER != (config->conf&CONF_HEADER)
> config->conf ^= CONF_HEADER; /* include the HTTP header as well */
> break;
> case 'j':
Actually, now that I think about it, from the manual:
"If this option is used twice, the second will again disable header include."
I guess if this is a bug, them you have to do a more in depth check,
like the -I option does.
Thanks,
Brock
Received on 2008-04-14