Merge pull request #12619 from owncloud/use-also-original-hea

Merge headers
This commit is contained in:
Morris Jobke 2014-12-04 16:59:42 +01:00
commit b6975143ff
2 changed files with 3 additions and 2 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);

View File

@ -173,7 +173,8 @@ class ControllerTest extends \Test\TestCase {
public function testFormatDataResponseJSON() {
$expectedHeaders = array(
'test' => 'something',
'Cache-Control' => 'no-cache, must-revalidate'
'Cache-Control' => 'no-cache, must-revalidate',
'Content-Type' => 'application/json; charset=utf-8'
);
$response = $this->controller->customDataResponse(array('hi'));