2 Replies Latest reply on Jul 29, 2019 6:43 AM by manivenkatesan.sct

    Wildfly 14 Server always responds with Content-Type as text/html instead of text/css

    manivenkatesan.sct

      Hi All,

      I am working on a migration project from Jboss EAP 6.2 to Wildfly 14 . I am facing css loading issue. Wildfly 14 Server always responds with Content-Type as text/html instead of text/css ,  so the css is not getting loaded in Chrome and FireFox browsers but working fine IE 11. Even i tried by adding filter as well MIME type in standalone.xml

       

        <filter-ref name="content-css" predicate="path-suffix['.css']"/>

       

      <response-header name="content-css" header-name="Content-Type" header-value="text/css"/> but didn't work .

       

      Here is the request and response  details

       

        1. Request URL: http://localhost:8080/myproject/struts/xhtml/styles.css
        2. Request Method: GET
        3. Status Code: 200 OK (from disk cache)
        4. Remote Address: 127.0.0.1:8080
        5. Referrer Policy: no-referrer-when-downgrade
      1. Response Headersview source
        1. Accept-Ranges: bytes
        2. Content-Language: en-US
        3. Content-Length: 1156
        4. Content-Type: text/html;charset=UTF-8       --> I suspect this is preventing the browser to load CSS because it's returned as html.
        5. Date: Tue, 23 Jul 2019 08:27:31 GMT
        6. Last-Modified: Mon, 22 Jul 2019 08:16:37 GMT
      2. Request Headers
        1. Provisional headers are shown

       

        1. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36