Bug 50624 - Patch to add WebM and WebP mime types.
Summary: Patch to add WebM and WebP mime types.
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Runtime Config (show other bugs)
Version: 2.5-HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2011-01-20 17:06 UTC by Mikołaj Zalewski
Modified: 2011-03-25 17:15 UTC (History)
0 users



Attachments
Patch adding WebP and WebM MIME types (1.99 KB, patch)
2011-01-20 17:06 UTC, Mikołaj Zalewski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikołaj Zalewski 2011-01-20 17:06:44 UTC
Created attachment 26524 [details]
Patch adding WebP and WebM MIME types

Currently, Apache 1.3.x and 2.x default configuration doesn't set MIME types for WebM and WebP files. This patches adds then to mime.types and magic. Also in magic, the patch removes the 'audio/unknown' result for files beginning with RIFF. This is because:
- It didn't work - if the file contained both the RIFF and WAVE magic string, the resulting MIME type was "audio/unknown\210yt\232r+audio/x-wav" (also, for the newly added WebP magic, the result was wrong in a similar way)
- I'm not sure if this was a good idea - the RIFF containers are also used for AVI videos and ANI animated cursor.

The patch applies cleanly to HEAD and branch 2.2.x. It applies with a small fuzz to the 1.3.x branch, but I'll also post a clean patch for 1.3.x.

Tested on Apache 2.2.3 and 1.3.x head. Demo:
http://www.mikolaj.zalewski.pl/test/test-webp.webp
http://www.mikolaj.zalewski.pl/test/test-webp.noext
http://www.mikolaj.zalewski.pl/test/test-webm.webm
http://www.mikolaj.zalewski.pl/test/test-webm.noext
Comment 1 Mikołaj Zalewski 2011-01-20 17:09:59 UTC
I've attached the 1.3.x patch to bug 50625.
Comment 2 Nick Kew 2011-01-20 19:03:08 UTC
Can you point to URLs documenting the registration of these types at IANA?
Comment 3 Roy T. Fielding 2011-03-25 17:15:39 UTC
Added the unregistered webm and webp media types in 1085507 and r1085522, respectively.  I did not add them to magic because those strings are not unique and magic shouldn't be used anyway.