markt       2005/01/15 12:31:21

  Modified:    catalina/src/share/org/apache/catalina/core
                        ApplicationHttpRequest.java
               webapps/docs changelog.xml
  Log:
  Fix bug 28222. request.getRequestURL() in forwarded jsp/servlet returns
    original url rather than new url as per SRV8.4. Uses same code as
    CoyoteRequest.getRequestURL()
    - Ported from TC4
  
  Revision  Changes    Path
  1.24      +28 -1     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationHttpRequest.java
  
  Index: ApplicationHttpRequest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationHttpRequest.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ApplicationHttpRequest.java       11 Jan 2005 20:39:52 -0000      1.23
  +++ ApplicationHttpRequest.java       15 Jan 2005 20:31:21 -0000      1.24
  @@ -448,6 +448,33 @@
   
   
       /**
  +     * Override the <code>getRequestURL()</code> method of the wrapped
  +     * request.
  +     */
  +    public StringBuffer getRequestURL() {
  +
  +        StringBuffer url = new StringBuffer();
  +        String scheme = getScheme();
  +        int port = getServerPort();
  +        if (port < 0)
  +            port = 80; // Work around java.net.URL bug
  +
  +        url.append(scheme);
  +        url.append("://");
  +        url.append(getServerName());
  +        if ((scheme.equals("http") && (port != 80))
  +            || (scheme.equals("https") && (port != 443))) {
  +            url.append(':');
  +            url.append(port);
  +        }
  +        url.append(getRequestURI());
  +
  +        return (url);
  +
  +    }
  +
  +
  +    /**
        * Override the <code>getServletPath()</code> method of the wrapped
        * request.
        */
  
  
  
  1.222     +4 -0      jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.221
  retrieving revision 1.222
  diff -u -r1.221 -r1.222
  --- changelog.xml     15 Jan 2005 18:18:31 -0000      1.221
  +++ changelog.xml     15 Jan 2005 20:31:21 -0000      1.222
  @@ -85,6 +85,10 @@
         <fix>
           <bug>32832</bug>: request.getSession(false) fails to return null 
(luehe)
         </fix>
  +      <fix>
  +        <bug>28222</bug>: request.getRequestURL() in forwarded jsp/servlet 
returns
  +        original url rather than new url as per SRV8.4 (markt)
  +      </fix>
       </changelog>
     </subsection>
   
  
  
  

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

Reply via email to