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

Re: Host header with an empty value?

From: Roy T. Fielding <fielding@gbiv.com>
Date: Tue, 19 Mar 2013 10:44:52 -0700
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Message-Id: <C9A90FCA-CE9F-48F8-AB26-815DE8CA2F01@gbiv.com>
To: Zhong Yu <zhong.j.yu@gmail.com>
On Mar 16, 2013, at 9:26 AM, 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.

HTTP can be used with any URI as a request target.  The sentence
tells the client what to do if that URI has no authority component.

  GET urn:ietf:rfc:2616.txt HTTP/1.1
  Host: 

Without that sentence, a reasonably sane person might conclude that
no Host header field would be sent, but that would result in a 400
error due to the IESG-imposed requirement in the first sentence.

....Roy
Received on Tuesday, 19 March 2013 17:45:16 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 19 March 2013 17:45:19 GMT