owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.36k stars 179 forks source link

unable to create resource using TUS inside `Shares` dir with spaces webdav #3048

Open kiranparajuli589 opened 2 years ago

kiranparajuli589 commented 2 years ago

Steps to reproduce

Steps to reproduce the behavior:

  1. create two users uu1 and uu2
  2. create a folder simple-folder using uu1
  3. share simple-folder with user uu2 using user uu1 with upload permissions
  4. uu2 accepts the incoming share
  5. uu2 tries to upload a file using the TUS protocol and spaces WebDAV api inside the received share dir

Expected behavior

Actual behavior

the POST request fails with status code 412:

POST /remote.php/dav/spaces/64ef9397-4f29-4c66-9821-9674a9392398 HTTP/1.1
Host: localhost:9200
Content-Length: 0
User-Agent: GuzzleHttp/7
Authorization: Basic QnJpYW46MTIzNA==
Upload-Length: 19
Upload-Metadata: filename L1NoYXJlcy90ZXh0RmlsZS50eHQ=
Tus-Resumable: 1.0.0
X-Request-ID: apiWebdavUploadTUS/uploadToShare.feature:341-328

HTTP/1.1 412 Precondition Failed
Access-Control-Allow-Headers: Tus-Resumable, Upload-Length, Upload-Metadata, If-Match
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Tus-Resumable, Location
Content-Length: 0
Content-Security-Policy: default-src 'none';
Date: Fri, 28 Jan 2022 07:22:20 GMT
Tus-Extension: creation,creation-with-upload,checksum,expiration
Tus-Resumable: 1.0.0
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.

```console OCIS_VERSION=v1.16.0 BRANCH=latest master ```

Additional context

The behavior is reproduced at https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L341

individual-it commented 2 years ago

Is this only a problem when using spaces or also without spaces? That is not clear to me reading the description and the example

kiranparajuli589 commented 2 years ago

Is this only a problem when using spaces or also without spaces? That is not clear to me reading the description and the example

@individual-it I've updated the issue title/description.