Skip to content

Commit 9c94483

Browse files
authored
[5.4] Fix headers are not sent correctly in com_media api controller (joomla#45150)
1 parent dcf125f commit 9c94483

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

administrator/components/com_media/src/Controller/ApiController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ private function sendResponse($data = null, int $responseCode = 200)
308308
$this->app->setHeader('Content-Type', 'application/json');
309309

310310
// Set the status code for the response
311-
http_response_code($responseCode);
311+
$this->app->setHeader('status', $responseCode);
312+
313+
// Send headers before sending the data
314+
$this->app->sendHeaders();
312315

313316
// Send the data
314317
echo new JsonResponse($data);

0 commit comments

Comments
 (0)