From d8142e866acb032d4b052249337c10f6e3978563 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 20 Mar 2023 20:28:26 +0000 Subject: [PATCH] accept last-modified from owncloud webdav extension --- copyparty/httpcli.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 76c56856..5ed761a9 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1464,6 +1464,16 @@ class HttpCli(object): if self.args.nw: return post_sz, sha_hex, sha_b64, remains, path, "" + at = mt = time.time() - lifetime + cli_mt = self.headers.get("x-oc-mtime") + if cli_mt: + try: + mt = int(cli_mt) + times = (int(time.time()), mt) + bos.utime(path, times, False) + except: + pass + if nameless and "magic" in vfs.flags: try: ext = self.conn.hsrv.magician.ext(path) @@ -1486,7 +1496,6 @@ class HttpCli(object): fn = fn2 path = path2 - at = time.time() - lifetime if xau and not runhook( self.log, xau, @@ -1494,7 +1503,7 @@ class HttpCli(object): self.vpath, self.host, self.uname, - at, + mt, post_sz, self.ip, at,