mkcalendar/mkcol: return CONFLICT in case of file name collision

This commit is contained in:
Peter Bieringer
2026-04-14 08:54:13 +02:00
parent 815191b2ec
commit 9fab1bc9cc
2 changed files with 4 additions and 0 deletions

View File

@@ -90,6 +90,8 @@ class ApplicationPartMkcalendar(ApplicationBase):
return httputils.FORBIDDEN return httputils.FORBIDDEN
else: else:
return httputils.INTERNAL_SERVER_ERROR return httputils.INTERNAL_SERVER_ERROR
elif type(e) is pathutils.CollidingPathError:
return httputils.CONFLICT
else: else:
logger.warning( logger.warning(
"Bad MKCALENDAR request on %r: %s", path, e, exc_info=True) "Bad MKCALENDAR request on %r: %s", path, e, exc_info=True)

View File

@@ -94,6 +94,8 @@ class ApplicationPartMkcol(ApplicationBase):
return httputils.FORBIDDEN return httputils.FORBIDDEN
else: else:
return httputils.INTERNAL_SERVER_ERROR return httputils.INTERNAL_SERVER_ERROR
elif type(e) is pathutils.CollidingPathError:
return httputils.CONFLICT
else: else:
logger.warning( logger.warning(
"Bad MKCOL request on %r (type:%s): %s", path, collection_type, e, exc_info=True) "Bad MKCOL request on %r (type:%s): %s", path, collection_type, e, exc_info=True)