use OCP\AppFramework\OCSController;
class V1Response extends BaseResponse {
-
/**
* The V1 endpoint has very limited http status codes basically everything
* is status 200 except 401
public function render() {
$meta = [
'status' => $this->getOCSStatus() === 100 ? 'ok' : 'failure',
- 'statuscode' => (string)$this->getOCSStatus(),
+ 'statuscode' => $this->getOCSStatus(),
'message' => $this->getOCSStatus() === 100 ? 'OK' : $this->statusMessage ?? '',
'totalitems' => (string)($this->itemsCount ?? ''),
'itemsperpage' => (string)($this->itemsPerPage ?? ''),
use OCP\AppFramework\OCSController;
class V2Response extends BaseResponse {
-
/**
* The V2 endpoint just passes on status codes.
* Of course we have to map the OCS specific codes to proper HTTP status codes
$meta = [
'status' => $status >= 200 && $status < 300 ? 'ok' : 'failure',
'statuscode' => $this->getOCSStatus(),
- 'message' => $status >= 200 && $status < 300 ? 'OK' : $this->statusMessage,
+ 'message' => $status >= 200 && $status < 300 ? 'OK' : $this->statusMessage ?? '',
];
if ($this->itemsCount !== null) {