cURL / Mailing Lists / curl-users / Single Mail

curl-users

--include and --head - option order is important

From: Brock Noland <brockn_at_gmail.com>
Date: Sun, 13 Apr 2008 22:13:55 -0500

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':
Received on 2008-04-14