It should be very safe to count on the host header. Maybe some really really old browser would not support that. But they probably won't work in today's WWW anyway. Majority of today's web site is likely to be virtually hosted. One Apache maybe hosting for 50 web addresses. If a client strip the host name and not sending the host header either the web server wouldn't what address it is really looking for. If you caught some request that doesn't have host header it is a good idea to redirect them to a browser upgrade page.


Thanks, aurora ;),

aurora wrote:
If you actually want the IP, resolve the host header would give you that.
I' m only interested in the hostname.

The second form of HTTP request without the host part is for compatability of pre-HTTP/1.1 standard. All modern web browser should send the Host header.
How safe is the assumtion that the Host header will be there? Is it part of the HTTP/1.1 spec? And does it mean all "pre 1.1" clients will fail? Hmm, maybe I should look on the wire whats really happening...

thanks again
  Paul

-- http://mail.python.org/mailman/listinfo/python-list

Reply via email to