From 4364581705a1b68ec9f18dfc9fe75675d8d2cef5 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 8 Sep 2023 19:49:29 +0000 Subject: [PATCH] fix accidental 422-ban when uploading lots of dupes --- copyparty/httpcli.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 95230118..c31e937e 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -629,7 +629,17 @@ class HttpCli(object): headers: Optional[dict[str, str]] = None, volsan: bool = False, ) -> bytes: - if status > 400 and status in (403, 404, 422): + if ( + status > 400 + and status in (403, 404, 422) + and ( + status != 422 + or ( + not body.startswith(b"
partial upload exists")
+                    and not body.startswith(b"
source file busy")
+                )
+            )
+        ):
             if status == 404:
                 g = self.conn.hsrv.g404
             elif status == 403: