#12789: ConditionalGetMiddleware behavior improvement.
----------------------------------------------+-----------------------------
Reporter: penzoil | Owner: nobody
Status: new | Milestone:
Component: Cache system | Version: SVN
Keywords: ETag, ConditionalGetMiddleware | Stage:
Unreviewed
Has_patch: 1 | Needs_docs: 1
Needs_tests: 1 | Needs_better_patch: 0
----------------------------------------------+-----------------------------
This patch is intended to improve the behavior of the
django.middleware.http.ConditionalGetMiddleware? middleware. When a
particular django view has at least two decorators that work with
redirecting behavior, Firefox will send a ETag that seems to be valid
since the response is nothing more than a Location redirect, thus the
content-length is 0 and the ETag is valid for the two steps created by the
two decorators that redirect the user to different pages (Example
decorator : @login_required and another that acts very similarly). The bug
is that the browser will receive a Not Modified header once the users
passes the first decorator when he gets redirected by to the original
view.
The FIX: The fix changes the behavior of the
django.middleware.http.ConditionalGetMiddleware? to not send a 304
response code if the content-length is 0 or undefined.
I'm not sure if it's proper, but it seems good of a fix and it actually
fixes my issue. So, I just wanted to shared it, hopefully it can make it
in the code-base.
This fix will require a little bit of documentation change to explain the
extra condition.
--
Ticket URL: <http://code.djangoproject.com/ticket/12789>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.