ocis icon indicating copy to clipboard operation
ocis copied to clipboard

GET request to non-existing file doesn't have response body

Open saw-jan opened this issue 3 years ago • 2 comments

Describe the bug

A GET request to non-existing file doesn't have response body and Content-Type header

Steps to reproduce

  1. Try to GET non-existing file
curl -uadmin:admin -XGET "https://host.docker.internal:9200/remote.php/dav/files/admin/nonExistentFile" -vk

Expected behavior

To have response body like in oC10:

< HTTP/1.1 404 Not Found
< Content-Length: 243
< Content-Type: application/xml; charset=utf-8
...
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
  <s:message>File with name nonExistentFile could not be located</s:message>
</d:error>

Actual behavior

Has no response body and no Content-Type:

< HTTP/1.1 404 Not Found
< Access-Control-Allow-Origin: *
< Content-Length: 0
< Content-Security-Policy: default-src 'none';
< Date: Mon, 10 Oct 2022 10:47:47 GMT
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS: `Infinite Scale 2.0.0-beta.8+7daf3c378 Community`

Additional context

Old issues: https://github.com/owncloud/ocis/issues/1282

saw-jan avatar Oct 10 '22 10:10 saw-jan

Do we want to keep the behavior as it is? CC @micbar @ScharfViktor

saw-jan avatar Jul 09 '24 09:07 saw-jan

Let us add the proper response body.

micbar avatar Jul 09 '24 09:07 micbar