cURL / Mailing Lists / curl-library / Single Mail

curl-library

[ curl-Bugs-1025986 ] Using "-H" to specify a "Host:" header. What happens during

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 10 Sep 2004 10:22:48 -0700

Bugs item #1025986, was opened at 2004-09-10 10:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1025986&group_id=976

Category: http
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Using "-H" to specify a "Host:" header. What happens during

Initial Comment:
VERSION: curl 7.12.1 (i686-pc-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.1
         (on Fedora Core2 with kernel 2.6.7)

Using:

  curl -L -H "Host: opelgt.freestoreclub.com" "http://216.53.142.159/"

(spamvertized site) (it gets back a "302" redirection)

(-L: follow redirection,
 -H: ("Host:) set HOST header
 in prior versions of curl the HOST header was kept for the redirection)

results in sending:

 (first access)
  Host: opelgt.freestoreclub.com

 (that gets a redirect:
   HTTP/1.1 302 Moved Temporarily
   location: a_home.asp)

which curl follows:

  GET /a_home.asp HTTP/1.1
  Host: 216.53.142.159
  Pragma: no-cache
  Accept: */*
  Host: opelgt.freestoreclub.com

TWO Host: headers?

(on the redirect, the "-H" switch does keep the original
 "Host:" header I specified which, on the first access
 replaced the default, but on the second access it does
 not replace the default, but is added to it creating
 the two Host headers)

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1025986&group_id=976
Received on 2004-09-10