cURL cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1491 Host-Header should be sent first

From: Daniel Stenberg <bagder_at_users.sf.net>
Date: Thu, 12 Mar 2015 11:54:34 +0000

- **status**: open-confirmed --> closed-fixed
- **Comment**:

Thanks!

Fixed in commit a5d994941c.

Man, that included updating 120 test cases to use the new order!

---
** [bugs:#1491] Host-Header should be sent first**
**Status:** closed-fixed
**Labels:** http 
**Created:** Mon Mar 09, 2015 02:05 PM UTC by rainer canavan
**Last Updated:** Mon Mar 09, 2015 02:15 PM UTC
**Owner:** Daniel Stenberg
rfc7230 recommends that the Host:-header should be sent first:
https://tools.ietf.org/html/rfc7230#section-5.4
  Since the Host field-value is critical information for handling a
  request, a user agent SHOULD generate Host as the first header field
  following the request-line.
If one explicitly sets a Host-header, curl emits such a "custom" Host:-header in the order it was set, i.e. not as  the first header as recommended by rfc7230:
The order is essentially the same with the curl command line tool and the
PHP curl bindings. 
$ nc -l 1234 &
[1] 50827
$ curl -vH 'X-foo: asdf' -H 'Host: asdf' http://127.0.0.1:1234/qwert
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 1234 (#0)
GET /qwert HTTP/1.1
User-Agent: curl/7.40.0
Accept: */*
X-foo: asdf
Host: asdf
GET /qwert HTTP/1.1
User-Agent: curl/7.40.0
Accept: */*
X-foo: asdf
Host: asdf
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2015-03-12

These mail archives are generated by hypermail.