cURL / Mailing Lists / curl-users / Single Mail

curl-users

-H 'Host: foo'

From: Jonathan H. Landis <jlandis_at_akamai.com>
Date: Wed, 7 Feb 2001 12:04:08 -0500

I don't seem to be able to override the Host: header that curl sets
automatically. Is there an easy way to do this? I've tried using
curl -H 'Host: foo' and according to the docs, -H will override the
existing header.

curl -v -H 'Host: foo' -o /dev/null http://curl.haxx.se/mail/

yields:

* Connected to curl.haxx.se (193.15.23.1)
> GET /mail HTTP/1.0
User-Agent: curl/6.0 (i686-pc-linux-gnu) libcurl 6.0 (SSL version 0.9.4)
Host: curl.haxx.se
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Host: foo
>
* 325 bytes transfered in 0.245 seconds (1327 bytes/sec).

Though from a packet sniff, curl hasn't modified the 'Host:' header (or added
another one...)

GET /mail/ HTTP/1.0\r\n
User-Agent: curl/6.0 (i686-pc-linux-gnu) libcurl 6.0 (SSL version 0.9.4)\r\n
Host: curl.haxx.se\r\n
Pragma: no-cache\r\n
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*\r\n

...

Is the 'Host:' header a special case? I'd like to use curl as a debugging
tool, but I need to be able to spoof host headers.

Please reply to me directly as well as the list, as I'm not a subscriber.

Thanks for your help.

Jon

-- 
Jonathan Landis
Akamai Technologies
Service Delivery Engineer, (617) 250-4649
jlandis_at_akamai.com
Received on 2001-02-07