webdav: mkdir semantics

This commit is contained in:
ed 2022-10-24 14:09:09 +02:00
parent ff04b72f62
commit f14369e038
2 changed files with 3 additions and 2 deletions

View file

@ -1759,10 +1759,10 @@ class HttpCli(object):
fdir = os.path.dirname(fn) fdir = os.path.dirname(fn)
if not bos.path.isdir(fdir): 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): if bos.path.isdir(fn):
raise Pebkac(500, "that folder exists already") raise Pebkac(405, "that folder exists already")
try: try:
bos.mkdir(fn) bos.mkdir(fn)

View file

@ -162,6 +162,7 @@ HTTPCODE = {
403: "Forbidden", 403: "Forbidden",
404: "Not Found", 404: "Not Found",
405: "Method Not Allowed", 405: "Method Not Allowed",
409: "Conflict",
411: "Length Required", 411: "Length Required",
412: "Precondition Failed", 412: "Precondition Failed",
413: "Payload Too Large", 413: "Payload Too Large",