Bug 24509 - mod_mime_magic fails to identify PNG images
Summary: mod_mime_magic fails to identify PNG images
Status: RESOLVED WONTFIX
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_mime_magic (show other bugs)
Version: 2.0.48
Hardware: All All
: P3 minor with 1 vote (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2003-11-07 19:10 UTC by Michael Fuhr
Modified: 2005-06-02 19:57 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Fuhr 2003-11-07 19:10:57 UTC
mod_mime_magic fails to identify PNG (Portable Network Graphics) images because
the stock magic file contains no description of the PNG format.

How to reproduce:

1. Build Apache with --enable-mime-magic.
2. Make sure MIMEMagicFile is set correctly in httpd.conf (it should be correct
in a default installation).
3. Put a PNG file somewhere in the document tree and give it a name without a
.png suffix.
4. Request the PNG file using a tool that allows you to view the HTTP response
headers, such as "wget -S".
5. Examine the Content-Type header.  Using the stock magic file, the type should
match the server's DefaultType setting (text/plain unless changed).

How to fix:

Add a description of the PNG format to the magic file.  This appears to work:

0       string          \x89PNG
>4      belong          0x0d0a1a0a      image/png

The PNG specification can be found at http://www.w3.org/TR/PNG

Thanks.
Comment 1 Jeff Trawick 2003-11-21 17:57:34 UTC
I'm going through the bug db to make sure patches are findable.  Please see 
http://httpd.apache.org/dev/patches.html
Comment 2 Paul Querna 2005-06-03 03:57:07 UTC
We aren't going to maintain the magic file ourselves.