简体   繁体   中英

Possible to use HTTP request to probe MIME configured in Apache settings?

This question is a bit weird. Given that I do not have access to the Apache server, I want to check if an Apache web server is using proper MIME type to handle specific file format, such as image/jpeg for .jpg files.

As MIME is shown in HTTP response, for example:

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

If a web server is configured incorrectly, for example adding:

AddHandler application/x-httpd-php .jpg

in .htaccess or in Apache configuration file, I would like to use HTTP request to diagnose. Is it possible? Will the Apache server responded with application/x-httpd-php when I'm requesting a .jpg from the server?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM