commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Dever <>
Subject Re: [Fwd: [HttpClient][PATCH] Correction to addHostRequestHeader+minor formatting cleanups]
Date Thu, 11 Jul 2002 13:00:36 GMT

> Actually, I think section of RFC 2616 covers this so that the
> Host header doesn't have to be conditionally sent.

I don't see how.  What that section says to me is that a HTTP/1.1 host
must send the Host header.  It does not say that HTTP/1.0 should send
the Host header.  I would expect a HTTP/1.0 compliant server to
completely ignore the Host header and look for the server in the URL and
only in the URL.

rfc1945 defines HTTP/1.0 and it does not have any refrence to a Host
header at all.  If it's not is the rfc, it should not be in the request
generated by HttpClient when not in HTTP/1.1 mode.

Its trival to check for anyway:
if (http11){
    //send the header


19.6.1 Changes from HTTP/1.0

   This section summarizes major differences between versions HTTP/1.0
   and HTTP/1.1. Changes to Simplify Multi-homed Web Servers and Conserve IP

   The requirements that clients and servers support the Host request-
   header, report an error if the Host request-header (section 14.23) is
   missing from an HTTP/1.1 request, and accept absolute URIs (section
   5.1.2) are among the most important changes defined by this

   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
   addresses and servers; there was no other established mechanism for
   distinguishing the intended server of a request than the IP address
   to which that request was directed. The changes outlined above will
   allow the Internet, once older HTTP clients are no longer common, to
   support multiple Web sites from a single IP address, greatly
   simplifying large operational Web servers, where allocation of many
   IP addresses to a single host has created serious problems. The
   Internet will also be able to recover the IP addresses that have been
   allocated for the sole purpose of allowing special-purpose domain
   names to be used in root-level HTTP URLs. Given the rate of growth of
   the Web, and the number of servers already deployed, it is extremely
   important that all implementations of HTTP (including updates to
   existing HTTP/1.0 applications) correctly implement these

      - Both clients and servers MUST support the Host request-header.

      - A client that sends an HTTP/1.1 request MUST send a Host header.

      - Servers MUST report a 400 (Bad Request) error if an HTTP/1.1
        request does not include a Host request-header.

      - Servers MUST accept absolute URIs.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message