From f1d007a51e58f90286c468202a19df3caf619688 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 15 Dec 2024 08:28:37 +0100 Subject: [PATCH] Fix: set PRODID on collection upload --- radicale/app/put.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radicale/app/put.py b/radicale/app/put.py index 6f883dca..bf559da0 100644 --- a/radicale/app/put.py +++ b/radicale/app/put.py @@ -29,7 +29,7 @@ from typing import Iterator, List, Mapping, MutableMapping, Optional, Tuple import vobject import radicale.item as radicale_item -from radicale import httputils, pathutils, rights, storage, types, xmlutils +from radicale import httputils, pathutils, rights, storage, types, xmlutils, utils from radicale.app.base import Access, ApplicationBase from radicale.hook import HookNotificationItem, HookNotificationItemTypes from radicale.log import logger @@ -37,6 +37,8 @@ from radicale.log import logger MIMETYPE_TAGS: Mapping[str, str] = {value: key for key, value in xmlutils.MIMETYPES.items()} +PRODID = u"-//Radicale//NONSGML Version " + utils.package_version("radicale") + "//EN" + def prepare(vobject_items: List[vobject.base.Component], path: str, content_type: str, permission: bool, parent_permission: bool, @@ -80,6 +82,7 @@ def prepare(vobject_items: List[vobject.base.Component], path: str, vobject_collection = vobject.iCalendar() for component in components: vobject_collection.add(component) + vobject_collection.add(vobject.base.ContentLine("PRODID", [], PRODID)) item = radicale_item.Item(collection_path=collection_path, vobject_item=vobject_collection) item.prepare()