cubicweb/web/http_headers.py
branch3.24
changeset 11883 0cb36982db94
parent 11057 0b59724cb3f2
child 12567 26744ad37953
--- a/cubicweb/web/http_headers.py	Wed Dec 07 14:07:35 2016 +0100
+++ b/cubicweb/web/http_headers.py	Sun Dec 04 23:45:52 2016 +0100
@@ -164,7 +164,7 @@
     """Convert an HTTP date string (one of three formats) to seconds since epoch."""
     parts = dateString.split()
 
-    if not parts[0][0:3].lower() in weekdayname_lower:
+    if parts and not parts[0][0:3].lower() in weekdayname_lower:
         # Weekday is stupid. Might have been omitted.
         try:
             return parseDateTime("Sun, "+dateString)