Set proper status code in OCS AppFramework Middleware
This commit is contained in:
parent
194c385c7a
commit
b543fd8d30
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue