From 6e715912f68a69afc7a45b0655f9d00cc06abed7 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 5 Jan 2015 12:32:22 +0100 Subject: [PATCH] Handle headers other than PRODID and VERSION (fix #250) --- radicale/ical.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/radicale/ical.py b/radicale/ical.py index 43a2f9e..23b6ae2 100644 --- a/radicale/ical.py +++ b/radicale/ical.py @@ -464,12 +464,11 @@ class Collection(object): """Find headers items in collection.""" header_lines = [] - lines = unfold(self.text) - for header in ("PRODID", "VERSION"): - for line in lines: - if line.startswith("%s:" % header): - header_lines.append(Header(line)) - break + lines = unfold(self.text)[1:] + for line in lines: + if line.startswith(("BEGIN:", "END:")): + break + header_lines.append(Header(line)) return header_lines