Do not use empty MIME type

This will turn on content sniffing in browser leading to unwanted
results.

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-07-13 10:27:43 +02:00
parent 56e1350118
commit 8f3ee9f9db

View File

@ -103,7 +103,7 @@ $response->getHeader()->sendHttpHeaders();
if (isset($ct) && ! empty($ct)) {
$mime_type = $ct;
} else {
$mime_type = (isset($mime_map[$transform_key]['mimetype'])
$mime_type = (!empty($mime_map[$transform_key]['mimetype'])
? str_replace('_', '/', $mime_map[$transform_key]['mimetype'])
: $default_ct)
. (isset($mime_options['charset']) ? $mime_options['charset'] : '');