From ec4a95e1a5aa31075cae6543cbd10da34a670596 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 19 Sep 2026 17:42:39 +0000 Subject: [PATCH] up2k nosub; closes #1611 --- copyparty/httpcli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index fea5cd206..d359b3a31 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -3251,6 +3251,8 @@ class HttpCli(object): dst = vfs.canonical(rem) try: if not bos.path.isdir(dst): + if "nosub" in vfs.flags: + raise Pebkac(500, "no subdirectories allowed") bos.makedirs(dst, vf=vfs.flags) except OSError as ex: self.log("makedirs failed %r" % (dst,)) @@ -3262,6 +3264,8 @@ class HttpCli(object): raise Pebkac(400, "some file got your folder name") raise Pebkac(500, min_ex()) + except Pebkac: + raise except: raise Pebkac(500, min_ex())