Sfoglia il codice sorgente

Handle headers other than PRODID and VERSION (fix #250)

Guillaume Ayoub 11 anni fa
parent
commit
6e715912f6
1 ha cambiato i file con 5 aggiunte e 6 eliminazioni
  1. 5 6
      radicale/ical.py

+ 5 - 6
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