Opened 5 years ago

Closed 4 years ago

#14747 closed (duplicate)

parse error on HTTP_IF_MODIFIED_SINCE header

Reported by: shaohua Owned by: nobody
Component: Core (Other) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)

Some mobile browsers send localized time in 'HTTP_IF_MODIFIED_SINCE' like: '???, 21 ?? 2010 05:55:07 GMT', which can not be correctly parsed and cause exceptions:

 File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 100, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/usr/local/lib/python2.6/dist-packages/django/views/static.py", line 61, in serve
   statobj[stat.ST_MTIME], statobj[stat.ST_SIZE]):

 File "/usr/local/lib/python2.6/dist-packages/django/views/static.py", line 129, in was_modified_since
   header_mtime = mktime_tz(parsedate_tz(matches.group(1)))

 File "/usr/lib/python2.6/email/_parseaddr.py", line 142, in mktime_tz
   if data[9] is None:

TypeError: 'NoneType' object is unsubscriptable

Change History (3)

comment:1 Changed 4 years ago by ramiro

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by ramiro

#14812 reports the same for the a virw included with the new staticfiles app.

comment:3 Changed 4 years ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed

I'm going to close this ticket as duplicate of #14812 because the affected code is the same, even if it's in a different location in trunk.

Note: See TracTickets for help on using tickets.
Back to Top