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=6942>.
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=6942

getRequestURL does not return a port number is request scheme is different then http 
or https

           Summary: getRequestURL does not return a port number is request
                    scheme is different then http or https
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Unknown
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


This is a problem in implementation of servlet api - 
javax.servlet.http.HttpUtils - getRequestURL (HttpServletRequest req) method. 
The method only assumes http and https urls. That is, if the request scheme is 
other than http or https then the port number of the server will not be 
included in the reconstructed url. 

The following code:

        if ((scheme.equals ("http") && port != 80)
                || (scheme.equals ("https") && port != 443)) {
            url.append (':');
            url.append (req.getServerPort ());
        }

should be replaced with:

if (! (  (scheme.equals("http") && port == 80) || 
         (scheme.equals("https") && port == 443) ) ) {
            url.append (':');
            url.append (req.getServerPort ());
        }

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to