Following the spec:

"`statuscode`: The OCS status code of the response, everything except 100 MUST be handled as failure."
This commit is contained in:
Thomas Müller 2015-08-05 17:49:44 +02:00
parent 7cb0934fa2
commit db1416346c
2 changed files with 2 additions and 6 deletions

View File

@ -444,11 +444,7 @@ class OC_API {
return $sc;
}
// any error codes > 100 are treated as client errors
if ($sc > 100 && $sc < 200) {
return Http::STATUS_BAD_REQUEST;
}
return Http::STATUS_OK;
return Http::STATUS_BAD_REQUEST;
}
/**

View File

@ -35,7 +35,7 @@ class OcsResponseTest extends \Test\TestCase {
return [
[Http::STATUS_OK, 100],
[Http::STATUS_BAD_REQUEST, 104],
[Http::STATUS_OK, 1000],
[Http::STATUS_BAD_REQUEST, 1000],
[201, 201],
];
}