2017-08-29 54 views
0

这个问题有点奇怪。鉴于我无法访问Apache服务器,我想检查Apache Web服务器是否使用适当的MIME类型来处理特定的文件格式,例如image/jpeg.jpg文件。可能使用HTTP请求来探测Apache设置中配置的MIME?

作为MIME示于HTTP响应,例如:

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做出回应吗?

回答

1

你可以做curl -I http://yoursite.com/test.jpg这将给你的内容类型作为回报以及其他信息。

+0

不错。更好的是,'curl -sI http://yoursite.com/test.jpg | grep“Content-Type”只输出Content-Type行。 – Raptor

相关问题