From 26342d2a62659e17bc711bb9d6369450b2e0e5a4 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Tue, 9 Jun 2026 21:34:15 +0200 Subject: [PATCH] sharing: adjust result codes for unsupported calls --- radicale/sharing/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/radicale/sharing/__init__.py b/radicale/sharing/__init__.py index 551450cd..0c010330 100644 --- a/radicale/sharing/__init__.py +++ b/radicale/sharing/__init__.py @@ -947,7 +947,7 @@ class BaseSharing: Conversion = request_data['Conversion'] # verify against whitelist if Conversion not in CONVERSIONS_WHITELIST: - return httputils.bad_request("Conversion not supported: %r" % Conversion) + return httputils.bad_request("Conversion is not supported: %r" % Conversion) if 'Actions' in request_data: valid = True # default @@ -1060,11 +1060,11 @@ class BaseSharing: return httputils.NOT_FOUND if not isinstance(item, storage.BaseCollection): logger.warning(api_info + ": PathMapped=%r is not a collection", PathMapped) - return httputils.METHOD_NOT_ALLOWED + return httputils.bad_request("PathMapped is not a collection") if Conversion == "bday": if item.tag != "VADDRESSBOOK": logger.warning(api_info + ": PathMapped=%r is not a VADDRESSBOOK collection (mandatory for Conversion=%r)", PathMapped, Conversion) - return httputils.METHOD_NOT_ALLOWED + return httputils.bad_request("Conversion is not supported for collection type") if Permissions is None: if ShareType == "token": @@ -1081,7 +1081,7 @@ class BaseSharing: for permission in Permissions: if permission not in "rPp": logger.warning(api_info + ": PathMapped=%r Permissions=%r not supported for Conversion=%r", PathMapped, Permissions, Conversion) - return httputils.METHOD_NOT_ALLOWED + return httputils.bad_request("Permissions are not supported for conversion") if Enabled is None: Enabled = False # security by default @@ -1299,7 +1299,7 @@ class BaseSharing: for permission in Permissions: if permission not in "rPp": logger.warning(api_info + ": PathMapped=%r Permissions=%r not supported for Conversion=%r", PathMapped, Permissions, Conversion) - return httputils.METHOD_NOT_ALLOWED + return httputils.bad_request("Permissions are not supported for conversion") if user == share['Owner']: if PathMapped is not None: