File modified time when uploading via webDav

The issue you are facing:
When uploading a file via webdav (using curl and easywebdav python library) the modified time of the uploaded file becomes the time the file was uploaded. Is this expected? I would have expected the modified time should be kept as the modified time of the file on the OS. Is there a way to pass what the modified time should be to NextCloud during the file upload?

URL used for webdav: https://hostname/remote.php/dav/files/user/filename

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Create a file on OS, wait a miniute or two
  2. upload file to nextcloud via webdav
  3. Verify the modified time on nextcloud is when the file was uploaded, not created.