cubicweb #5280949 httpcache / http_headers crash in parseDateTime [open]

2015-04-20 10:04:48 - (cubicweb.web) ERROR: IndexError('list index out of range',)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/application.py", line 462, in core_handle
    result = controller.publish(rset=rset)
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/views/basecontrollers.py", line 132, in publish
    if self._cw.is_client_cache_valid():
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/request.py", line 776, in is_client_cache_valid
    validators = get_validators(self._headers_in)
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/httpcache.py", line 161, in get_validators
    value = headers_in.getHeader(header)
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/http_headers.py", line 1384, in getHeader
    return self._toParsed(name)
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/http_headers.py", line 1341, in _toParsed
    h = self.handler.parse(name, r)
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/http_headers.py", line 76, in parse
    header = p(header)
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/http_headers.py", line 626, in parseIfModifiedSince
    return parseDateTime(header.split(';', 1)[0])
  File "/usr/lib/python2.7/dist-packages/cubicweb/web/http_headers.py", line 164, in parseDateTime
    if not parts[0][0:3].lower() in weekdayname_lower:
IndexError: list index out of range

looks like we're trusting user submitted data to be well formed (either that, or misparsing well-formed data).

prioritynormal
typebug
done in<not specified>
load0.500
load left0.500
closed by<not specified>