W3C home > Mailing lists > Public > ietf-http-wg@w3.org > January to March 2013

Re: Host header with an empty value?

From: Willy Tarreau <w@1wt.eu>
Date: Sat, 16 Mar 2013 17:43:37 +0100
To: Zhong Yu <zhong.j.yu@gmail.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Message-ID: <20130316164337.GE9060@1wt.eu>
On Sat, Mar 16, 2013 at 11:26:15AM -0500, Zhong Yu wrote:
> Quoting http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-22#section-5.4
> 
>    A client MUST send a Host header field in all HTTP/1.1 request
>    messages.
> 
>    If the target URI includes an authority component, then
>    the Host field-value MUST be identical to that authority component
>    after excluding any userinfo (Section 2.7.1).
> 
>    If the authority
>    component is missing or undefined for the target URI, then the Host
>    header field MUST be sent with an empty field-value.
> 
> Can someone elaborate on the last sentence and give an example? Thanks.

It means that if the only thing you know is the path on the target server
and you have no idea about the host, then you must send the Host header
field anyway, but it must be left empty. For example, a load balancer
may send the following request to check that a server is alive or not,
whatever the virtual hosts installed on the server :

        GET /alive HTTP/1.1
        Host:

Regards,
Willy
Received on Saturday, 16 March 2013 16:44:08 GMT

This archive was generated by hypermail 2.3.1 : Saturday, 16 March 2013 16:44:09 GMT