[Django] #22440: Incorrect Behavior of ConditionalGetMiddleware

11 views
Skip to first unread message

Django

unread,
Apr 14, 2014, 4:49:17 PM4/14/14
to django-...@googlegroups.com
#22440: Incorrect Behavior of ConditionalGetMiddleware
-------------------------------+--------------------
Reporter: mlavin | Owner: mlavin
Type: Uncategorized | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
There is an edge case where the {{{ConditionalGetMiddleware}}} violates
RFC 2616 in particular
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26

> If the request would, without the If-None-Match header field, result in
anything other than a 2xx or 304 status, then the If-None-Match header
MUST be ignored.

The middleware currently does not check the original response status code
before the If-None-Match. This is correctly handled by the
{{{CommmonMiddleware}}} which has a similar check. This was pointed out in
#12789 which tried to fix/address a related but seperate problem with how
the ETag is actually generated. #17834 currently tracks problems with the
generation of the ETag and this issue only tracks the problem with
{{{ConditionalGetMiddleware}}} using the ETag however it may have been
generated

--
Ticket URL: <https://code.djangoproject.com/ticket/22440>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 14, 2014, 5:00:10 PM4/14/14
to django-...@googlegroups.com
#22440: Incorrect Behavior of ConditionalGetMiddleware
-------------------------------+--------------------------------------

Reporter: mlavin | Owner: mlavin
Type: Uncategorized | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by mlavin):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Same check for the status code is needed for the If-Modified-Since:

> If the request would normally result in anything other than a 200 (OK)
status, or if the passed If-Modified-Since date is invalid, the response
is exactly the same as for a normal GET. A date which is later than the
server's current time is invalid.

--
Ticket URL: <https://code.djangoproject.com/ticket/22440#comment:1>

Django

unread,
Apr 14, 2014, 7:49:42 PM4/14/14
to django-...@googlegroups.com
#22440: Incorrect Behavior of ConditionalGetMiddleware
-------------------------------+--------------------------------------

Reporter: mlavin | Owner: mlavin
Type: Uncategorized | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by mlavin):

* has_patch: 0 => 1


Comment:

Added PR https://github.com/django/django/pull/2555

--
Ticket URL: <https://code.djangoproject.com/ticket/22440#comment:2>

Django

unread,
Apr 15, 2014, 3:06:52 AM4/15/14
to django-...@googlegroups.com
#22440: Incorrect Behavior of ConditionalGetMiddleware
-------------------------------+------------------------------------

Reporter: mlavin | Owner: mlavin
Type: Uncategorized | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by julien):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22440#comment:3>

Django

unread,
Apr 30, 2014, 7:30:02 AM4/30/14
to django-...@googlegroups.com
#22440: Incorrect Behavior of ConditionalGetMiddleware
-------------------------------+------------------------------------
Reporter: mlavin | Owner: mlavin
Type: Bug | Status: new

Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timo):

* type: Uncategorized => Bug


--
Ticket URL: <https://code.djangoproject.com/ticket/22440#comment:4>

Django

unread,
Jun 13, 2014, 8:04:05 PM6/13/14
to django-...@googlegroups.com
#22440: Incorrect Behavior of ConditionalGetMiddleware
-------------------------------+------------------------------------
Reporter: mlavin | Owner: mlavin
Type: Bug | Status: closed

Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"79956d06946c881cb71958f27a12f62b9cab8de5"]:
{{{
#!CommitTicketReference repository=""
revision="79956d06946c881cb71958f27a12f62b9cab8de5"
Fixed #22440 -- Updated ConditionalGetMiddleware to comply with RFC 2616.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22440#comment:5>

Reply all
Reply to author
Forward
0 new messages