diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-07-22 12:14:54 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-07-22 12:53:47 +0200 |
commit | b543fd8d30279b829524b6736084f8d7348aa3ef (patch) | |
tree | 5b5333b187231a61489985761bd3283cd81ea6a7 | |
parent | 194c385c7a3200ca939f4ee85c3230cdb869f98e (diff) | |
download | nextcloud-server-b543fd8d30279b829524b6736084f8d7348aa3ef.tar.gz nextcloud-server-b543fd8d30279b829524b6736084f8d7348aa3ef.zip |
Set proper status code in OCS AppFramework Middleware
-rw-r--r-- | lib/private/AppFramework/Middleware/OCSMiddleware.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Middleware/OCSMiddleware.php b/lib/private/AppFramework/Middleware/OCSMiddleware.php index 90355a39ef0..0d97aa6ed94 100644 --- a/lib/private/AppFramework/Middleware/OCSMiddleware.php +++ b/lib/private/AppFramework/Middleware/OCSMiddleware.php @@ -56,7 +56,12 @@ class OCSMiddleware extends Middleware { if ($code === 0) { $code = Http::STATUS_INTERNAL_SERVER_ERROR; } - return new OCSResponse($format, $code, $exception->getMessage()); + $response = new OCSResponse($format, $code, $exception->getMessage()); + + if ($this->request->getScriptName() === '/ocs/v2.php') { + $response->setStatus($code); + } + return $response; } throw $exception; |