]> source.dussan.org Git - nextcloud-server.git/commitdiff
Set proper content type on OCS responses
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 08:55:56 +0000 (10:55 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 08:55:56 +0000 (10:55 +0200)
lib/private/AppFramework/OCS/BaseResponse.php

index c9295a26779c864bc53d035abeb6af265c2d11ae..fa22498ac0fdc06d25603d2cc57f8fb545b83e46 100644 (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'
+                       );
+               }
        }
 
        /**