Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.0.X, Master
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>org.apache.catalina.filters.CorsFilter</filter-class> <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