owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.36k stars 2.06k forks source link

No OCS message when updating a share #37653

Open individual-it opened 4 years ago

individual-it commented 4 years ago

Request:

PUT /owncloud-core/ocs/v1.php/apps/files_sharing/api/v1/shares/391 HTTP/1.1
Host: localhost
User-Agent: GuzzleHttp/6.5.4 curl/7.68.0 PHP/7.3.19-1+ubuntu20.04.1+deb.sury.org+1
Authorization: Basic QWxpY2U6MTIzNDU2
OCS-APIREQUEST: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 14

permissions=31

Response:

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
  <totalitems></totalitems>
  <itemsperpage></itemsperpage>
 </meta>
 <data>
  <id>391</id>
  <share_type>0</share_type>
  <uid_owner>Alice</uid_owner>
  <displayname_owner>Alice Hansen</displayname_owner>
  <permissions>31</permissions>
  <stime>1594023692</stime>
  <parent/>
  <expiration/>
  <token/>
  <uid_file_owner>Alice</uid_file_owner>
  <displayname_file_owner>Alice Hansen</displayname_file_owner>
  <additional_info_owner/>
  <additional_info_file_owner/>
  <path>/Alice-folder</path>
  <item_type>folder</item_type>
  <mimetype>httpd/unix-directory</mimetype>
  <storage_id>home::Alice</storage_id>
  <storage>556</storage>
  <item_source>2147537010</item_source>
  <file_source>2147537010</file_source>
  <file_parent>2147536991</file_parent>
  <file_target>/Alice-folder</file_target>
  <share_with>Brian</share_with>
  <share_with_displayname>Brian Murphy</share_with_displayname>
  <share_with_additional_info/>
  <mail_send>0</mail_send>
  <attributes/>
 </data>
</ocs>

I would expect it to be <message>OK</message>

probably that is the case in more places, the API tests don't check the message a lot

found it when looking into https://github.com/owncloud/ocis-reva/issues/332

phil-davis commented 4 years ago

And are these supposed to be ok Ok or OK

JammingBen commented 3 years ago

I'm not sure here, why should this request include a message? The status (-code) already has all necessary information, right? Also keep in mind that 1xx codes in general should not include any type of message or body: https://greenbytes.de/tech/webdav/draft-ietf-httpbis-p1-messaging-26.html#message.body