[ticket/14285] Send content-type is application/octet-stream if uknown

PHPBB3-14285
This commit is contained in:
Rubén Calvo 2018-07-11 07:52:09 +02:00 committed by rubencm
parent dc1d3683a8
commit 821964dc7a

View file

@ -88,12 +88,14 @@ class controller
{ {
try try
{ {
$this->response->headers->set('Content-Type', $file_info->mimetype); $content_type = $file_info->mimetype;
} }
catch (\phpbb\storage\exception\exception $e) catch (\phpbb\storage\exception\exception $e)
{ {
// Just don't send this header $content_type = 'application/octet-stream';
} }
$this->response->headers->set('Content-Type', $content_type);
} }
if (!$this->response->headers->has('Content-Length')) if (!$this->response->headers->has('Content-Length'))