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

Lexicon icons are missing from web page

    Details

      Description

      Description

      Lexicon icons are missing from web page because Tomcat CORS configuration is conflicted with our configuration added in LPS-72903.

      Reproduction Steps

      1. Add an entry to your system's hosts file as following:

      127.0.0.1	abc.com
      

      2. Use Liferay DXP SP4 and create a portal-ext.properties file with the following properties:

      redirect.url.ips.allowed=
      cdn.host.http=http://abc.com:8080/
      cdn.dynamic.resources.enabled=false
      

      3. Modify web.xml under tomcat-8.0.32\conf for the following:

        <filter>
              <filter-name>CorsFilter</filter-name>
                <filter-class&gt;org.apache.catalina.filters.CorsFilter</filter-class&gt;
                <init-param>
                  <param-name>cors.allowed.origins</param-name>
                  <param-value>http://localhost:8080</param-value>
                </init-param>
                <init-param>
                  <param-name>cors.allowed.methods</param-name>
                  <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
                </init-param>
      	  <init-param>
                  <param-name>cors.allowed.headers</param-name>
                  <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
                </init-param>
                <init-param>
                  <param-name>cors.exposed.headers</param-name>
                  <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
                </init-param>
                <init-param>
                  <param-name>cors.support.credentials</param-name>
                  <param-value>true</param-value>
                </init-param>
                <init-param>
                  <param-name>cors.preflight.maxage</param-name>
                  <param-value>10</param-value>
                </init-param>
        </filter>
        <filter-mapping>
              <filter-name>CorsFilter</filter-name>
              <url-pattern>/*</url-pattern>
         </filter-mapping>
      

      4. Start up Liferay and visit http://localhost:8080
      5. Navigate to Content > Web Content
      Actual Result: Lexicon icons are missing. In the response header, it shows the following. PFA SP4-CORS-cdn.jpg

      Access-Control-Allow-Origin   *, http://localhost:8080
      

      Expected Result: Lexicon icons should display properly and the response header should be

      Access-Control-Allow-Origin   http://localhost:8080
      

      The issue is reproduced on master: 7227093900666b12759b383063ac60a03956fa6c

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hong.zhao Hong Zhao (Inactive)
              Reporter:
              david.zhang David Zhang (Inactive)
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 10 weeks, 6 days ago

                  Packages

                  Version Package
                  7.1.X
                  Master