Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-23581

[GSS](7.4.z) UNDERTOW-2094 - Bad relative redirect is generated if app is mapped to trailing slash context

XMLWordPrintable

      If an app is bound to a context with a trailing slash:

      <context-root>/app/</context-root>
      

      Then relative redirects can be incorrect. For instance, if requesting /app/redirect.jsp then response.sendRedirect("newpage.jsp") would previously return a location of /app/newpage.jsp. But now it results in /app/redirect.jspnewpage.jsp.

      That's because after UNDERTOW-1409, this:

                          current = current.substring(0, lastSlash + 1);
      

      Does not see a last slash and so does not modify the current string, meaning that this:

                      realPath = CanonicalPathUtils.canonicalize(servletContext.getContextPath() + current + location);
      

      ends up being called with values like /app/+redirect.jsp+newpage.jsp.

            rhn-support-ivassile Ilia Vassilev
            rhn-support-aogburn Aaron Ogburn
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: