The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Http_host
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-24-2007
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
You probably have mixed something up, if I did not misunderstand your question.

It's not HTTP_HOST that derives from a Perl env var. It's that CGI, or a similar mechanism, that exposes the HTTP/1.1 header "Host:" as the HTTP_HOST env var to the server process responsible for handling the request, which can probably be a Perl process, as specified in the CGI Specification, that writes "... the header lines received from the client, if any, are placed into the environment with the prefix HTTP_ followed by the header name. Any - characters in the header name are changed to _ characters.".

As for how the "Host" HTTP header is composed, it actually follows what the HTTP specification says about the header. To save space, you can read the specifics at http://www.w3.org/Protocols/rfc2616/....html#sec14.23.

Last edited by cbkihong; 05-24-2007 at 04:36 PM..