Skip to content

Commit d83e9b9

Browse files
authored
Merge pull request #2129 from joinemm/pr-fix-rstrip
Fix bday conversion hrefs for vCard filenames ending in v/c/f
2 parents def9298 + b8977aa commit d83e9b9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

radicale/app/propfind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def xml_propfind_response(
159159
if uri.startswith(share['PathMapped']):
160160
uri = str(share['PathOrToken']) + uri.removeprefix(share['PathMapped'])
161161
if share_bday_automap and uri.endswith(".vcf"):
162-
uri = uri.rstrip(".vcf") + ".ics"
162+
uri = uri.removesuffix(".vcf") + ".ics"
163163

164164
href.text = xmlutils.make_href(base_prefix, uri)
165165
response.append(href)

radicale/item/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def convert_vcf_to_ics(self) -> Union["Item", None]:
592592

593593
href = self.href
594594
if href is not None:
595-
href = href.rstrip(".vcf") + ".ics"
595+
href = href.removesuffix(".vcf") + ".ics"
596596

597597
etag = self.etag
598598
# replace 14 leading chars of etag "<hexdigits>" by special format bda0YYYYMMDD00

0 commit comments

Comments
 (0)