diff --git a/api/RestfulServer.php b/api/RestfulServer.php index d54f783ddcf..3d0f29efd86 100644 --- a/api/RestfulServer.php +++ b/api/RestfulServer.php @@ -549,22 +549,26 @@ protected function permissionFailure() { // return a 401 $this->getResponse()->setStatusCode(401); $this->getResponse()->addHeader('WWW-Authenticate', 'Basic realm="API Access"'); + $this->getResponse()->addHeader('Content-Type', 'text/plain'); return "You don't have access to this item through the API."; } protected function notFound() { // return a 404 $this->getResponse()->setStatusCode(404); + $this->getResponse()->addHeader('Content-Type', 'text/plain'); return "That object wasn't found"; } protected function methodNotAllowed() { $this->getResponse()->setStatusCode(405); + $this->getResponse()->addHeader('Content-Type', 'text/plain'); return "Method Not Allowed"; } protected function unsupportedMediaType() { $this->response->setStatusCode(415); // Unsupported Media Type + $this->getResponse()->addHeader('Content-Type', 'text/plain'); return "Unsupported Media Type"; }