mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
ef86b16854
commit
dda14e8959
@ -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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user