mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #7608 from bummzack/patch-1
Fix HTTP::get_mime_type with uppercase filenames.
This commit is contained in:
commit
29e57d8015
@ -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');
|
||||
|
||||
|
@ -179,6 +179,7 @@ class HTTPTest extends FunctionalTest {
|
||||
$this->assertEquals('image/gif', HTTP::get_mime_type(FRAMEWORK_DIR.'/tests/control/files/file.gif'));
|
||||
$this->assertEquals('text/html', HTTP::get_mime_type(FRAMEWORK_DIR.'/tests/control/files/file.html'));
|
||||
$this->assertEquals('image/jpeg', HTTP::get_mime_type(FRAMEWORK_DIR.'/tests/control/files/file.jpg'));
|
||||
$this->assertEquals('image/jpeg', HTTP::get_mime_type(FRAMEWORK_DIR.'/tests/control/files/upperfile.JPG'));
|
||||
$this->assertEquals('image/png', HTTP::get_mime_type(FRAMEWORK_DIR.'/tests/control/files/file.png'));
|
||||
$this->assertEquals('image/vnd.adobe.photoshop',
|
||||
HTTP::get_mime_type(FRAMEWORK_DIR.'/tests/control/files/file.psd'));
|
||||
|
BIN
tests/control/files/upperfile.JPG
Normal file
BIN
tests/control/files/upperfile.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 331 B |
Loading…
x
Reference in New Issue
Block a user