I'm using the Chrome and the Spring security and I got the following error message:
Refused to execute script from 'http://<server url>/assets/app.js' because its MIME type ('') is not executable
in the Chrome browser. The application is working with the IE and the Firefox browsers, because they don't care the missing MIME type. How the change the configuration and fix the problem?
I have an other project and its source code. When I run the other project and the app.js is returned from the server there are in the response headers the content type "application/javascript". But when I search for the source code I don't find the string "application/javascript". So how this is configured? The string "application/javascript" is not configured in the application server, because all the Jetty configuration are in the source files.
One solution is to add to the web.xml
<mime-mapping>
<extension>js</extension>
<mime-type>application/javascript</mime-type>
</mime-mapping>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments