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

Mtime is not set while uploading file with X-OC-Mtime header (async uploads) #5279

Closed
saw-jan opened this issue Dec 22, 2022 · 2 comments
Closed
Labels

Comments

@saw-jan
Copy link
Member

saw-jan commented Dec 22, 2022

Steps to reproduce

  1. Start oCIS with async uploads enabled: STORAGE_USERS_OCIS_ASYNC_UPLOADS=true (and with OCIS_INSECURE=true until Fix Postprocessing service #5269)
  2. Upload a file with X-OC-Mtime header set (1565237893 - Thu, 08 Aug 2019 04:18:13 GMT)
curl -XPUT "https://localhost:9200/remote.php/webdav/simple.txt" \
-H"X-OC-Mtime: 1565237893" -d"uploaded" -uadmin:admin -vk
< HTTP/1.1 201 Created
< Access-Control-Allow-Origin: *
< Content-Length: 0
< Content-Security-Policy: default-src 'none';
< Date: Thu, 22 Dec 2022 09:23:01 GMT
< Last-Modified: Thu, 08 Aug 2019 04:18:13 +0000
< Oc-Fileid: 88a1e29d-dd38-46c7-b1fc-582996e9f0d1$612f56c1-05cd-4b4c-85a8-4de7b51f3048!05cd354c-bd04-4fc8-a9b2-8b80f8f8d19c
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Oc-Mtime: accepted
< X-Permitted-Cross-Domain-Policies: none
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
<
  1. Get the mtime of that file
curl -XPROPFIND "https://localhost:9200/remote.php/webdav/simple.txt" \
-d'<?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:getlastmodified/></d:prop></d:propfind>' \
-uadmin:admin -vk | xmllint --format -
< HTTP/1.1 207 Multi-Status
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Tus-Resumable, Tus-Version, Tus-Extension
< Content-Length: 330
< Content-Security-Policy: default-src 'none';
< Content-Type: application/xml; charset=utf-8
< Date: Thu, 22 Dec 2022 09:26:18 GMT
< Dav: 1, 3, extended-mkcol
< Tus-Extension: creation,creation-with-upload,checksum,expiration
< Tus-Resumable: 1.0.0
< Tus-Version: 1.0.0
< Vary: Prefer
< 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"?>
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/webdav/simple.txt</d:href>
    <d:propstat>
      <d:prop>
        <d:getlastmodified>Thu, 22 Dec 2022 09:23:01 GMT</d:getlastmodified>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Expected behavior

To have the provided mtime Thu, 08 Aug 2019 04:18:13 GMT but is Thu, 22 Dec 2022 09:23:01 GMT

Actual behavior

Provided mtime is not set

@micbar
Copy link
Contributor

micbar commented Dec 28, 2022

@kobergj This is a bug and needs to be fixed.

@saw-jan
Copy link
Member Author

saw-jan commented Jan 2, 2023

Fixed in PR cs3org/reva#3571

@saw-jan saw-jan closed this as completed Jan 2, 2023
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