Fixed #7046 -- set the response status code correctly in ConditionalGetMiddleware.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7793 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6d5c868e86
commit
94beaa6ebb
|
@ -19,14 +19,14 @@ class ConditionalGetMiddleware(object):
|
||||||
# Setting the status is enough here. The response handling path
|
# Setting the status is enough here. The response handling path
|
||||||
# automatically removes content for this status code (in
|
# automatically removes content for this status code (in
|
||||||
# http.conditional_content_removal()).
|
# http.conditional_content_removal()).
|
||||||
response.status = 304
|
response.status_code = 304
|
||||||
|
|
||||||
if response.has_header('Last-Modified'):
|
if response.has_header('Last-Modified'):
|
||||||
if_modified_since = request.META.get('HTTP_IF_MODIFIED_SINCE', None)
|
if_modified_since = request.META.get('HTTP_IF_MODIFIED_SINCE', None)
|
||||||
if if_modified_since == response['Last-Modified']:
|
if if_modified_since == response['Last-Modified']:
|
||||||
# Setting the status code is enough here (same reasons as
|
# Setting the status code is enough here (same reasons as
|
||||||
# above).
|
# above).
|
||||||
response.status = 304
|
response.status_code = 304
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue