Merge pull request #18084 from owncloud/ocs-anything-other-then-100-means-failure
[OCS] Error handling - fix in status code mapper
This commit is contained in:
commit
923a22a11e
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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],
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue