owncloud / product

ownCloud Product Backlog
GNU Lesser General Public License v3.0
0 stars 1 forks source link

[OCIS] invalid status code on OCS requests for object that doesn't exist #250

Closed dpakach closed 9 months ago

dpakach commented 4 years ago

the ocs status code when requesing user that doesn't exists should be 404 but returns 998

❯ curl -X GET https://localhost:9200/ocs/v2.php/cloud/users/michaelsdsfs -ks | xmllint --format -
<?xml version="1.0" encoding="UTF-8"?>
<ocs>
  <meta>
    <status>error</status>
    <statuscode>998</statuscode>
    <message>The requested user could not be found</message>
  </meta>
</ocs>

on OC10

❯ curl -XGET http://localhost/fed/ocs/v2.php/cloud/users/michaelsdsfs -u admin:admin -ks
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>404</statuscode>
  <message>The requested user could not be found</message>
 </meta>
 <data/>
</ocs>
phil-davis commented 4 years ago

@dpakach your OCIS example is with v1.php and the oC10 example is with v2.php - those do have different ocs status codes anyway.

dpakach commented 4 years ago

@dpakach your OCIS example is with v1.php and the oC10 example is with v2.php - those do have different ocs status codes anyway.

Yes, updated now. But the result is still same

dpakach commented 3 years ago

Also same result for shares


❯ curl https://localhost:9200/ocs/v2.php/apps/files_sharing/api/v1/shares/716sdfdsf -u admin:admin -k
<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>998</statuscode><message>share not found</message></meta></ocs>%  
saw-jan commented 9 months ago

Fixed by https://github.com/cs3org/reva/pull/4529 and https://github.com/owncloud/ocis/pull/8412