Set proper content type on OCS responses

This commit is contained in:
Roeland Jago Douma 2016-09-07 10:55:56 +02:00
parent 0027304b5f
commit 240798329d
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 10 additions and 0 deletions

View File

@ -68,6 +68,16 @@ abstract class BaseResponse extends Response {
$this->setLastModified($dataResponse->getLastModified());
$this->setCookies($dataResponse->getCookies());
$this->setContentSecurityPolicy($dataResponse->getContentSecurityPolicy());
if ($format === 'json') {
$this->addHeader(
'Content-Type', 'application/json; charset=utf-8'
);
} else {
$this->addHeader(
'Content-Type', 'application/xml; charset=utf-8'
);
}
}
/**