diff --git a/lib/Controller/ExportController.php b/lib/Controller/ExportController.php index e7c7af1..c365a44 100644 --- a/lib/Controller/ExportController.php +++ b/lib/Controller/ExportController.php @@ -52,7 +52,7 @@ class ExportController extends Controller { /** * @NoAdminRequired */ - public function index(): Response { + public function index() { $xml = new SimpleXMLElement(''); $xml->addAttribute('encoding', 'UTF-8'); $trackList = $xml->addChild('trackList'); @@ -72,10 +72,12 @@ class ExportController extends Controller { $export_name = '"' . $productName . ' Radio Favorites (' . $userName . ') (' . $dateTime->formatDate(time()) . ').xspf"'; - header('Content-Type: application/xspf+xml'); - header('Content-Disposition: attachment; filename=' . $export_name); + $response = new Response(); + $response->addHeader('Content-Type', 'application/xspf+xml'); + $response->addHeader('Content-Disposition', 'attachment; filename=' . $export_name); + $response->render(); //return new DataResponse($this->service->findAll($this->userId)); - return new Response($xml->asXML()); + return $response; //return $xml->asXML(); }