Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-130105

JBoss 7.2 wrong pathinfo comes encoded in I18nServlet resulting in double encoding

    Details

      Description

      Description:

      Not sure if this is a server error or a Liferay Portal one, but JBoss 7.2 encodes the path info in the request.
      I think because when not passing through /web/ is not using VirtualHostFilter to redirects it with the Dispatcher which encodes it.

      These because with Tomcat everything works fine, but in JBoss 7.2 it doesn't, for example what it happens in JBoss 7.2:
      1. When used by specifying the full site, for example /en/web/guest/guía the httpServletRequest.getPathInfo() comes without encoding the characters (see screenshot_1)
      2. But when it is not used specifying the complete site, more exactly without /web/, for example /es/guía the httpServletRequest.getPathInfo() is encoded /web/guest/gu%C3%ADa (see screenshot_2), the problem is that it will be encoded again here String redirect = HttpUtil.encodePath(path); and there is the bug and the code breaks because /web/guest/gu%25C3%25ADa is encoded twice and the page would not be found.

      From what I have been able to observe is that the path info of the httpServletRequest is coming encoded a long time before reaching this getI18nData method and that is why I am thinking that it is something of URL encoding generated by JBoss 7.2 (see last two screenshots with the request, screenshot_3 when it works and the last one screenshot_4 when it doesn't work).

      What we need to find is to know if we address this as a bug of Liferay Portal, and we fix by checking if this path info comes already encoded, so we don't do it twice. Because I have my doubts after checking the documentation HttpServletRequest.html#getPathInfo() is expected to not be encoded, so it might be a server fault.

      If this is a server error related to JBoss 7.2 (not sure if other versions are affected) in this case what should we suggest to our clients?

      Steps to reproduce:

      1. Use this documentation to install JB oss-eap-7.2.0.zip on a DXP 7.2 FP9
      2. Go to /jboss-eap-7.2.0/bin and run  ./standalone.sh if windows the standalone.bat one
      3. Once you set up the server, add a new page with a special character for example guía 
      4. Access this page by clicking view or navigating to it /web/guest/guía (works because doesn't come encoded but also is not passing through I18nServlet)
      5. Now use the short URL /guía (works because is not passing through I18nServlet, but it comes encoded)
      5. Now use the long URL with another available language in front so is passing through I18nServlet for example Spanish /es/web/guest/guía (works because doesn't come encoded)
      6. Now use the short URL with another available language in front so is passing through I18nServlet for example Spanish /es/guía (doesn't work because comes encoded as it gets forwarded on VirtualHostFilter.java#L364  and is passing through I18nServlet that will encode again the URL, and as a result the page would not be found)

      Actual: In JBoss 7.2 the path info comes encoded if not passing through /web/guest/ and if redirected through I18nServlet gets encoded twice and the page would not be found and fails to navigate 

      Expected: Find a solution that is less impacting that support this fail in JBoss 7.2 either in our portal or through JBoss configuration

      Note: Affects Jboss 7.3 as well 

      * Please see Zendesk Support tab for further comments and attachments.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              georgel.pop Georgel Vasile Pop
              Participants of an Issue:
              Recent user:
              Clarissa Velazquez
              Engineering Assignee:
              Georgel Vasile Pop
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                16 weeks, 2 days ago

                  Packages

                  Version Package
                  7.1.10 DXP FP25
                  7.1.X
                  7.2.10 DXP FP14
                  7.2.10.5 DXP SP5
                  7.2.X
                  7.3.7 CE GA8
                  7.3.10 DXP FP2
                  7.3.X
                  7.4.1 CE GA2 DXP 7,4
                  7.4.2 CE GA3 DXP 7,4
                  Master