Skip to content

Commit

Permalink
Merge pull request #1654 from pbiering/set-prodid-on-collection-upload
Browse files Browse the repository at this point in the history
Set prodid on collection upload
  • Loading branch information
pbiering authored Dec 15, 2024
2 parents 4d04c85 + 7597c7d commit b7ae6b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Improve: auth.ldap config shown on startup, terminate in case no password is supplied for bind user
* Add: option [auth] uc_username for uppercase conversion (similar to existing lc_username)
* Add: option [debug] storage_cache_action for conditional logging
* Fix: set PRODID on collection upload (instead of vobject is inserting default one)

## 3.3.1

Expand Down
9 changes: 7 additions & 2 deletions radicale/app/put.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Copyright © 2008 Nicolas Kandel
# Copyright © 2008 Pascal Halter
# Copyright © 2008-2017 Guillaume Ayoub
# Copyright © 2017-2018 Unrud <[email protected]>
# Copyright © 2017-2020 Unrud <[email protected]>
# Copyright © 2020-2023 Tuna Celik <[email protected]>
# Copyright © 2024-2024 Peter Bieringer <[email protected]>
#
# This library is free software: you can redistribute it and/or modify
Expand All @@ -29,14 +30,17 @@
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, utils,
xmlutils)
from radicale.app.base import Access, ApplicationBase
from radicale.hook import HookNotificationItem, HookNotificationItemTypes
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,
Expand Down Expand Up @@ -80,6 +84,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()
Expand Down

0 comments on commit b7ae6b3

Please sign in to comment.