You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/01/09 14:01:29 UTC

DO NOT REPLY [Bug 5762] New: - CGI servlet misses to include port number in HTTP_HOST environment variable

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5762>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5762

CGI servlet misses to include port number in HTTP_HOST environment variable

           Summary: CGI servlet misses to include port number in HTTP_HOST
                    environment variable
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: Georg.Koltermann@mscsoftware.com


The HTTP_HOST environment variable reflects the value of the
"host" request header.  This works well with practically any
standard web server.

Tomcat 4.0.1 sets this variable incorrectly, giving just the
bare host name without the port number.

The problem can be seen by running the following simple CGI script
once on a normal web server (on a custom port) and then
on Tomcat (on a custom port).

#!/usr/bin/perl
print "Content-type: text/plain\n\n";

my $http_host = $ENV{HTTP_HOST};

print "HTTP_HOST was $http_host\n";

exit 0;

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>