Skip to content
Snippets Groups Projects

Fix mime-type guesser for Drupal >= 10.3.2

1 file
+ 2
3
Compare changes
  • Side-by-side
  • Inline
@@ -55,9 +55,8 @@ class HttpMimeTypeGuesser implements MimeTypeGuesserInterface {
if ($filename = $this->parseFileNameFromUrl($path)) {
$mimetype = $this->extensionGuesser->guessMimeType($filename);
if ($mimetype !== 'application/octet-stream') {
// Only return the guessed mime type if it found a valid match
// instead of returning the default mime type.
if ($mimetype !== NULL) {
// Only return the guessed mime type if it found a valid match.
return $mimetype;
}
}
Loading