diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-07 10:55:56 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-07 10:55:56 +0200 |
commit | 240798329d17750dd39463a16ed106b923725fd8 (patch) | |
tree | f43d65aea874cca7700f9ee49578864e2e6e15bd | |
parent | 0027304b5fc0a92106dca948b72b6fad04b91299 (diff) | |
download | nextcloud-server-240798329d17750dd39463a16ed106b923725fd8.tar.gz nextcloud-server-240798329d17750dd39463a16ed106b923725fd8.zip |
Set proper content type on OCS responses
-rw-r--r-- | lib/private/AppFramework/OCS/BaseResponse.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/AppFramework/OCS/BaseResponse.php b/lib/private/AppFramework/OCS/BaseResponse.php index c9295a26779..fa22498ac0f 100644 --- a/lib/private/AppFramework/OCS/BaseResponse.php +++ b/lib/private/AppFramework/OCS/BaseResponse.php @@ -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' + ); + } } /** |