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

Friendly URL beginning with the same string as proxy path is filtered wrong

    Details

      Description

      1. Create a page called 'pathproxy_sitename'
      2. Access the page via its friendly url: http://localhost:8080/pathproxy_sitename, see it is working
      3. Stop portal
      4. Set portal.proxy.path=/pathproxy
      5. Set up apache 2.2 virtualhost:
        <VirtualHost *>
        ProxyPreserveHost On
        ProxyPass /pathproxy ajp://localhost:8009
        ProxyPassReverse /pathproxy ajp://localhost:8009
        </VirtualHost>
        
      6. Run apache httpd
      7. Restart portal
      8. Try to access http://localhost/pathproxy/pathproxy_sitename

      Expected result: Browser loads test page

      Details:

      VirtualHostFilter.java
      if (Validator.isNotNull(contextPath) &&
      	friendlyURL.contains(contextPath)) {
      
      	friendlyURL = friendlyURL.substring(contextPath.length());
      }
      

      if friendlyURL is "/company_", and contextPath is "/company" friendlyURL.contains(contextPath) is true
      and so the friendlyURL gets shortened to _ which is wrong.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              zsolt.olah Zsolt Oláh (Inactive)
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 5 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 Beta 7