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

Filters handled by InvokerFilter are bahaving differently depending how they are called first time.

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 6.2.0 CE GA1, 6.2.1 CE GA2, 6.2.2 CE GA3 , 6.2.3 CE GA4, 6.2.4 CE GA5, 6.2.5 CE GA6, 6.2.10 EE GA1, 6.2.X EE
    • Fix Version/s: None
    • Component/s: Core Infrastructure
    • Labels:
      None

      Description

      Prepare the environment

      Download Liferay 6.2 SP20 or patch it to latest fixpack169 or even first community edition, all have this issue.

      Unzip the Liferay 6.2 zip and go to Liferay home directory (bundle root).

      The run following commands.

      mv tomcat* tomcat
      mkdir tomcat/webapps/ROOT/omg
      echo "<html><head></head><body><h1>you should see me</h1></body></html>" > tomcat/webapps/ROOT/omg/wtf.jsp
      

      Create portal-ext.properties with values:

      admin.email.from.address=test@liferay.com
      admin.email.from.name=Test Test
      setup.wizard.enabled=false
      
      browser.launcher.url=
      
      com.liferay.portal.servlet.filters.cache.CacheFilter=false
      

      At this test, we remove to CacheFilter make sure that behavior is consistent and also disable browser.launcher.url to avoid undesired effects.

      Test 1

      Start portal (remove temp and logs):

      rm -Rf logs/* tomcat/work/* tomcat/temp/* tomcat/logs/* ; ./tomcat/bin/catalina.sh run
      

      With another terminal

      Run command

      curl -vs "http://localhost:8080/omg/wtf.jsp?minifierType=js&minifierBundleId=javascript.everything.files" 2>/dev/null | grep "AUI" | wc -l
      

      That should return correctly 0.

      Run command

      curl -vs "http://localhost:8080/omg/wtf.jsp?myurl=http://localhost:8080/html/js/everything.jsp?browserId=other&themeId=classic&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.everything.files&languageId=en_US&b=6210&t=1" 2>/dev/null | grep "AUI" | wc -l
      

      That should return correctly 0.

      Stop portal with CTRL+C.

      Test 2

      Now we run curl commands in a different order and we get a different result.

      Start portal ( and remove temp and logs):

      rm -Rf logs/* tomcat/work/* tomcat/temp/* tomcat/logs/* ; ./tomcat/bin/catalina.sh run
      

      Open another terminal

      Run command

      curl -vs "http://localhost:8080/omg/wtf.jsp?myurl=http://localhost:8080/html/js/everything.jsp?browserId=other&themeId=classic&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.everything.files&languageId=en_US&b=6210&t=1" 2>/dev/null | grep "AUI" | wc -l
      

      That should return 0 but it does return 2 . Of course if you look by looking the configuration or AggregateFilter configuration at liferay-web.xml you realize above url will return AUI JavaScript even it should not.

      Run command

      curl -vs "http://localhost:8080/omg/wtf.jsp?minifierType=js&minifierBundleId=javascript.everything.files" 2>/dev/null | grep "AUI" | wc -l
      

      That should return 0 but it does return 2 . This means that somehow now after second load it is hitting again Aggregate filter even though it should not. This is due the InvokerFilter is somehow caching the result.

      Reason for this

      At Test 1 this blocks the AggregateFilter url-regex-pattern parameter evaluation.

      	<filter>
      		<filter-name>Aggregate Filter - JSP</filter-name>
      		<filter-class&amp;gt;com.liferay.portal.servlet.filters.aggregate.AggregateFilter</filter-class&amp;gt;
      		<init-param>
      			<param-name>url-regex-pattern</param-name>
      			<param-value>.+/(aui_lang|barebone|css|everything|main)\.jsp</param-value>
      		</init-param>
      	</filter> 
      

      and Test 2 it is working differently, but then also assuming that Aggregate filter should be there.

      This is valid for all 6.2 versions including fixpack 169.

        Attachments

          Activity

            People

            • Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              sammso Sampsa Sohlman
              Participants of an Issue:
              Recent user:
              Sampsa Sohlman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                30 weeks, 6 days ago

                Packages

                Version Package