From 821964dc7ab6e74d6caeed24ab44c79702db3384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= <rubencm@gmail.com> Date: Wed, 11 Jul 2018 07:52:09 +0200 Subject: [PATCH] [ticket/14285] Send content-type is application/octet-stream if uknown PHPBB3-14285 --- phpBB/phpbb/storage/controller/controller.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/storage/controller/controller.php b/phpBB/phpbb/storage/controller/controller.php index 9cfcf77041..63080645d3 100644 --- a/phpBB/phpbb/storage/controller/controller.php +++ b/phpBB/phpbb/storage/controller/controller.php @@ -88,12 +88,14 @@ class controller { try { - $this->response->headers->set('Content-Type', $file_info->mimetype); + $content_type = $file_info->mimetype; } 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'))