【发布时间】:2020-03-30 15:33:17
【问题描述】:
我正在尝试确定文件的 MIME 类型。在 Firefox 中,它显示text/cache-manifest。在 Chrome 中,F-12 -> Network Tab 在type 下显示为document。当我查看响应标头时,它从不显示Content-Type,所以也许我的服务器没有发送它?还是我把document 解释错了?
在 .htaccess 中,我有:AddType text/cache-manifest .manifest
编辑:我也试过下面的代码,它仍然在 Chrome 中显示类型为document:
manifest.php
<?php header("content-type: text/cache-manifest");?>
【问题讨论】:
-
您是说即使您将
Content-Type标头设置为header(),您仍然看不到从您的服务器返回的HTTP 响应标头中? -
@w3d 不,当我设置它时,我确实在响应标头中看到了它(不是
.manifest文件,但我是 PHP 文件)但它仍然显示“类型”为document在网络标签上。
标签: html .htaccess google-chrome