[web/http_headers] do not crash when IfModifiedSince is empty string (closes #16527954)
--- 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)