diff --git a/radicale/tests/static/broken-vcard.vcf b/radicale/tests/static/broken-vcard.vcf new file mode 100644 index 0000000..140ddc2 --- /dev/null +++ b/radicale/tests/static/broken-vcard.vcf @@ -0,0 +1,8 @@ +BEGIN:VCARD +VERSION:3.0 +PRODID:-//Inverse inc.//SOGo Connector 1.0//EN +UID:C68582D2-2E60-0001-C2C0-000000000000.vcf +X-MOZILLA-HTML:FALSE +EMAIL;TYPE=work:test-misses-N-or-FN@example.com +X-RADICALE-NAME:C68582D2-2E60-0001-C2C0-000000000000.vcf +END:VCARD diff --git a/radicale/tests/static/broken-vevent.ics b/radicale/tests/static/broken-vevent.ics new file mode 100644 index 0000000..a6244ea --- /dev/null +++ b/radicale/tests/static/broken-vevent.ics @@ -0,0 +1,15 @@ +BEGIN:VCALENDAR +PRODID:-//Radicale//NONSGML Radicale Server//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20160725T060147Z +LAST-MODIFIED:20160727T193435Z +DTSTAMP:20160727T193435Z +UID:040000008200E00074C5B7101A82E00800000000 +SUMMARY:Broken ICS END of VEVENT missing by accident +STATUS:CONFIRMED +X-MOZ-LASTACK:20160727T193435Z +DTSTART;TZID=Europe/Budapest:20160727T170000 +DTEND;TZID=Europe/Budapest:20160727T223000 +CLASS:PUBLIC +X-LIC-ERROR:No value for LOCATION property. Removing entire property: diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index aa73e8e..29c98f6 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -28,6 +28,7 @@ in them for XML requests (all but PUT). import posixpath import re import xml.etree.ElementTree as ET +from pprint import pprint from collections import OrderedDict from datetime import datetime, timedelta, timezone from http import client @@ -552,7 +553,8 @@ def propfind(base_prefix, path, xml_request, read_collections, else: response = _propfind_response( base_prefix, path, collection, props, user, write=True) - multistatus.append(response) + if response: + multistatus.append(response) for collection in read_collections: if collection in collections: continue @@ -563,7 +565,8 @@ def propfind(base_prefix, path, xml_request, read_collections, else: response = _propfind_response( base_prefix, path, collection, props, user, write=False) - multistatus.append(response) + if response: + multistatus.append(response) return client.MULTI_STATUS, _pretty_xml(multistatus)