Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using with spaces dav, TUS upload file with invalid name sends false response #3050

Open
kiranparajuli589 opened this issue Jan 28, 2022 · 2 comments
Labels

Comments

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Jan 28, 2022

Describe the bug

Creating a new TUS resource on WebDAV API with invalid names like " " sends a false response. It exits with 201 but the resource is not present for the requesting user.

Steps to reproduce

Steps to reproduce the behavior:

  1. create user uu1
  2. create a new TUS resource on the WebDAV API with these headers using the spaces WebDAV api
  • Upload-Length: 100
  • Upload-Metadata: filename <metadata>
  • Tus-Resumable: 1.0.0

Expected behavior

The HTTP status code should be 412

Actual behavior

The HTTP status code should is 201, but the file is also not found after the request.

POST /remote.php/dav/spaces/8efd4443-4ef5-400d-8719-d705f1eaf790 HTTP/1.1
Host: localhost:9200
Content-Length: 0
User-Agent: GuzzleHttp/7
Authorization: Basic QWxpY2U6MTIzNDU2
Upload-Length: 100
Upload-Metadata: filename bXkMaWxl
Tus-Resumable: 1.0.0
X-Request-ID: apiWebdavUploadTUS/uploadFile.feature:209-183

HTTP/1.1 201 Created
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 09:15:53 GMT
Location: https://localhost:9200/data/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNjQzNDQ3NzUzLCJpYXQiOjE2NDMzNjEzNTMsInRhcmdldCI6Imh0dHA6Ly9sb2NhbGhvc3Q6OTE1OC9kYXRhL3R1cy82Y2RiZGE2Mi04MzNlLTQxYTItOWJjMy1jN2VjMWZkMmE2NTkifQ.PcvjmvtfLHUjslFTisdJsa_zte1UJnmnyueKQ47rEM0
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

Then PROPFIND:

PROPFIND /remote.php/dav/spaces/8efd4443-4ef5-400d-8719-d705f1eaf790/my%5C%5Cfile HTTP/1.1
Host: localhost:9200
User-Agent: GuzzleHttp/7
Authorization: Basic QWxpY2U6MTIzNDU2
Depth: 0
X-Request-ID: apiWebdavUploadTUS/uploadFile.feature:209-191
Content-Length: 243

<?xml version="1.0"?>
				<d:propfind
				   xmlns:d="DAV:"
				   xmlns:oc="http://owncloud.org/ns"
				   xmlns:ocs="http://open-collaboration-services.org/ns"
				   >
				    <d:prop><d:getetag/><d:resourcetype/></d:prop>
				</d:propfind>HTTP/1.1 404 Not Found
Access-Control-Allow-Origin: *
Content-Length: 211
Content-Security-Policy: default-src 'none';
Content-Type: text/xml; charset=utf-8
Date: Fri, 28 Jan 2022 09:15:53 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

<?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>Resource /my\\file not found</s:message></d:error>

Setup

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

OCIS_VERSION=v1.16.0
BRANCH=latest master

@kiranparajuli589 kiranparajuli589 changed the title upload file with invalid name succeeds with spaces DAV TUS upload file with invalid name sends false response Jan 28, 2022
@individual-it
Copy link
Member

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 kiranparajuli589 changed the title TUS upload file with invalid name sends false response using with spaces dav, TUS upload file with invalid name sends false response Jan 31, 2022
@kiranparajuli589
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants