From f14369e0380881995613f9b34a3ce5c026278601 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 24 Oct 2022 14:09:09 +0200 Subject: [PATCH] webdav: mkdir semantics --- copyparty/httpcli.py | 4 ++-- copyparty/util.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 5e317be6..142eee3d 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1759,10 +1759,10 @@ class HttpCli(object): fdir = os.path.dirname(fn) if not bos.path.isdir(fdir): - raise Pebkac(500, "parent folder does not exist") + raise Pebkac(409, "parent folder does not exist") if bos.path.isdir(fn): - raise Pebkac(500, "that folder exists already") + raise Pebkac(405, "that folder exists already") try: bos.mkdir(fn) diff --git a/copyparty/util.py b/copyparty/util.py index a0a4708f..7a65f6e5 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -162,6 +162,7 @@ HTTPCODE = { 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", + 409: "Conflict", 411: "Length Required", 412: "Precondition Failed", 413: "Payload Too Large",