diff --git a/core/lib/Drupal/Core/File/MimeType/MimeTypeMapper.php b/core/lib/Drupal/Core/File/MimeType/MimeTypeMapper.php index 680e94d..ac68b2d 100644 --- a/core/lib/Drupal/Core/File/MimeType/MimeTypeMapper.php +++ b/core/lib/Drupal/Core/File/MimeType/MimeTypeMapper.php @@ -898,6 +898,7 @@ protected function getMapping() { * {@inheritdoc} */ public function addMapping($mimetype, $extension) { + $extension = strtolower($extension); if (!in_array($mimetype, $this->mapping['mimetypes'])) { $this->mapping['mimetypes'][] = $mimetype; } diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index f7e2192..929feaa 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -459,10 +459,8 @@ function responsive_image_get_mime_type($image_style_name, $extension) { if ($image_style_name == RESPONSIVE_IMAGE_EMPTY_IMAGE) { return 'image/gif'; } - // The MIME type guesser needs a full path, not just an extension, but the - // file doesn't have to exist. - $fake_path = 'responsive_image.' . ImageStyle::load($image_style_name)->getDerivativeExtension($extension); - return Drupal::service('file.mime_type.guesser.extension')->guess($fake_path); + $extension = ImageStyle::load($image_style_name)->getDerivativeExtension($extension); + return Drupal::service('file.mime_type.mapper')->getMimeTypeForExtension($extension); } /**