MIME type ('application/json') is not executable, and strict MIME type checking is enabled
Hi Team,
I have recently migrated the spring boot version from '1.3.2.RELEASE' to ‘1.4.0.RELEASE', while loading the JSP I am getting the below error in Chrome (version: Version 52.0.2743.116 m)
/jscript/jquery.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
/jscript /jquery.dataTables.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
GET http://localhost:8080/std/jscript/jquery-ui.js
GET http://localhost:8080/std/jscript/jquery-ui.min.js
List_std:51 Uncaught ReferenceError: $ is not defined
End point has the following annotation :
@RequestMapping(value = "/studnets/all" ,method = RequestMethod.GET, headers = "Accept=application/json", produces = "application/json" )
It was working fine with '1.3.2.RELEASE’ of spring boot in both Chrome and Firefox browsers. But with ‘1.4.0.RELEASE' it’s working fine in Firefox, not in Chrome. We didn’t set any X-Content-Type-Options options code.
Serving JavaScript as application/json doesn't look right to me and I suspect is what's causing Chrome to complain. I can't tell what's causing the problem from what you've told us thus far. Can you share a sample that reproduces the problem please?
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
FYI - this is probably due to an invalid Content-Type header in the response. JSONP requires the header value application/javascript.