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 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"');