Merge headers

Otherwise the headers from `JSONResponse` are gone and the Content-Type of the response would be `text/html` instead of `application/json; charset=utf-8`. This leads to broken scripts since we set the `nosniff` tag, furthermore this is very bad from a security PoV.
This commit is contained in:
Lukas Reschke 2014-12-04 14:45:15 +01:00
parent e9f0b30023
commit db9765b4d5
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ abstract class Controller {
$data->getData(),
$data->getStatus()
);
$response->setHeaders($data->getHeaders());
$response->setHeaders(array_merge($data->getHeaders(), $response->getHeaders()));
return $response;
} else {
return new JSONResponse($data);