Fix HTTP::get_mime_type with uppercase filenames.

The fallback of `HTTP::get_mime_type` (that uses a lookup instead of `finfo`) doesn't ensure the extension is converted to lowercase before the lookup. A file named `Image.JPG` will return `'application/unknown'`.
This change fixes this issue.
This commit is contained in:
Roman Schmid 2017-11-16 11:07:20 +01:00 committed by Daniel Hensby
parent ef86b16854
commit dda14e8959
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -271,7 +271,7 @@ class HTTP {
// Fallback to use the list from the HTTP.yml configuration and rely on the file extension
// to get the file mime-type
$ext = File::get_file_extension($filename);
$ext = strtolower(File::get_file_extension($filename));
// Get the mime-types
$mimeTypes = Config::inst()->get('HTTP', 'MimeTypes');