2017-08-29 59 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