mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Optimized clean response handling
This commit is contained in:
@@ -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));
|
||||
|
Reference in New Issue
Block a user