Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-789

Static files defined in lang-addon.xml are served with invalid content-type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.11
    • 5.0.10
    • None
    • None

      If I have some static files defined in lang-addon.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <language-addon>
        <addon-name>test</addon-name>
        <language-name>xul/html</language-name>
      
        <javascript src="~./test.js" />
        <stylesheet href="~./test.css" />
      </language-addon>
      

      When the browser asks for test.js, I would expect the Content-Type header to have the value "application/javascript" or "application/javascript;charset=SOME_CHARSET".
      When the browser asks for test.css, I would expect the header to have the value "text/css" or "text/css;charset=SOME_CHARSET".

      Currently ZK sets the header to either ";charset=SOME_CHARSET" or ";charset=SOME_CHARSET;charset=SOME_CHARSET" which are both invalid.
      I'm not 100% sure but I think ";charset=SOME_CHARSET" is returned if the app is running on Tomcat 7, while the other is returned if the app is running on Jetty 8.

      The biggest problem is that IE9 requires all CSS files to have proper "text/css" content type, so all CSS files that are defined in lang-addon are ignored for security reasons.
      This causes the component styles to be missing with IE9.

            jumperchen jumperchen
            gekkio gekkio
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: