Optimized clean response handling

This commit is contained in:
Bernd Bestel
2021-07-12 17:08:59 +02:00
parent 2cc4f4d382
commit f1da3ef5e8
3 changed files with 2 additions and 3 deletions

View File

@@ -49,7 +49,6 @@ class FilesApiController extends BaseApiController
if (file_exists($filePath))
{
ob_clean(); // Make sure to ONLY return the file
$response->write(file_get_contents($filePath));
$response = $response->withHeader('Cache-Control', 'max-age=2592000');
$response = $response->withHeader('Content-Type', mime_content_type($filePath));
@@ -81,7 +80,6 @@ class FilesApiController extends BaseApiController
if (file_exists($filePath))
{
ob_clean(); // Make sure to ONLY return the file
$response->write(file_get_contents($filePath));
$response = $response->withHeader('Cache-Control', 'max-age=2592000');
$response = $response->withHeader('Content-Type', mime_content_type($filePath));