Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#14812 closed (fixed)

Wrong processing of If-Modified-Since header

Reported by: alexey.smolsky@… Owned by: nobody
Component: Contrib apps Version: master
Severity: Keywords: static files, If-Modified-Since
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)

I have faced with this issue when Opera 10.63 sent requests like that:

'HTTP_IF_MODIFIED_SINCE': ': 1291108438, Wed, 20 Oct 2010 14:05:00 GMT',
'HTTP_USER_AGENT': 'Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.6.30 Version/10.63'

It seems that IF_MODIFIED_SINCE header is invalid. I don't exactly why... But in RFC2616(HTTP/1.1) we can see a case: "...if the passed If-Modified-Since date is invalid, the response is exactly the same as for a normal GET". So I think, it would be better if django.contrib.staticfiles will handle this case with simple check. I've attached patch.

Attachments (1)

rev14693_staticfiles.diff (738 bytes) - added by alexey.smolsky@… 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by alexey.smolsky@…

comment:1 Changed 4 years ago by alexey.smolsky@…

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by ramiro

  • Description modified (diff)
  • Triage Stage changed from Unreviewed to Accepted

See also #14747.

comment:3 Changed 4 years ago by ramiro

  • Needs tests set
  • Version changed from 1.2 to SVN

comment:4 Changed 4 years ago by ramiro

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

(In [14753]) Fixed #14812 -- Made parsing of the If-Modified-Since HTTP header more robust in presence of malformed values when serving static content. Thanks shaohua for the report, and alexey.smolsky@… for a similar report and patch.

comment:5 Changed 4 years ago by ramiro

(In [14754]) [1.2.X] Fixed #14812 -- Made parsing of the If-Modified-Since HTTP header more robust in presence of malformed values when serving static content. Thanks shaohua for the report, and alexey.smolsky@… for a similar report and patch.
Backport of r14753 from trunk.

comment:6 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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