mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Make sure to clean the response before returning files
Was a problemw when returning images and there were leading empty lines in config.php which seem to get added to the response always...
This commit is contained in:
@@ -49,6 +49,7 @@ class CalendarApiController extends BaseApiController
|
||||
$vCalendar->addEvent($vEvent);
|
||||
}
|
||||
|
||||
ob_clean(); // Make sure to ONLY return the file
|
||||
$response->write((new CalendarFactory())->createCalendar($vCalendar));
|
||||
$response = $response->withHeader('Content-Type', 'text/calendar; charset=utf-8');
|
||||
return $response->withHeader('Content-Disposition', 'attachment; filename="grocy.ics"');
|
||||
|
Reference in New Issue
Block a user