资源解释为Image但使用MIME类型application / octet-stream传输

时间:2013-08-22 12:33:23

标签: javascript html css browser mime-types

加载我的页面时,我收到此警告:

Resource interpreted as Image but transferred with MIME type application/octet-stream

我的页面正在加载jpeg图片。服务器将图像字节写入输出流并将其发送到客户端。

我该怎么做才能阻止此警告?

1 个答案:

答案 0 :(得分:2)

您必须设置正确的Mime类型 为图像设置正确的Content-Type http标头 例如,jpeg图像将具有Content-Type: image/jpeg