because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enable

because its MIME type ('text/html') is not executable, and strict MIME type checking is enable

该句的含义是:因为页面返回的mime类型是text/html,所以不可执行,而且浏览器开启了mime类型检测

问题场景:我的php站点开启了https,设置了严格的header策略;当web首页登录时,调用的php验证码函数返回类型未设置mime type,所以验证码显示异常。

解决办法:在返回函数部分添加@header("content-type: text/javascript; charset=utf-8");

站点登录页验证码显示正常。

You may also like...

发表评论