Set proper content type on OCS responses
This commit is contained in:
parent
0027304b5f
commit
240798329d
|
@ -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'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue