是否可以使用HTTP请求来探测Apache设置中配置的MIME



这个问题有点奇怪。鉴于我没有访问Apache服务器的权限,我想检查Apache web服务器是否使用正确的MIME类型来处理特定的文件格式,例如.jpg文件的image/jpeg

如HTTP响应中显示的MIME,例如:

accept-ranges:bytes
alt-svc:quic=":443"; ma=2592000; v="39,38,37,35"
cache-control:private, max-age=31536000
content-length:16786
content-type:image/jpeg <---
date:Mon, 21 Aug 2017 09:56:08 GMT
expires:Mon, 21 Aug 2017 09:56:08 GMT
last-modified:Wed, 14 Dec 2016 20:30:00 GMT
server:sffe
status:200
x-content-type-options:nosniff
x-xss-protection:1; mode=block

如果web服务器配置不正确,例如添加:

AddHandler application/x-httpd-php .jpg

.htaccess或Apache配置文件中,我想使用HTTP请求进行诊断。有可能吗?当我从服务器请求.jpg时,Apache服务器会用application/x-httpd-php响应吗?

您可以执行curl -I http://yoursite.com/test.jpg,它将为您提供内容类型和其他信息作为回报。

最新更新