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:
Malcolm Tredinnick 2008-06-30 07:03:58 +00:00
parent 6d5c868e86
commit 94beaa6ebb
1 changed files with 2 additions and 2 deletions

View File

@ -19,14 +19,14 @@ class ConditionalGetMiddleware(object):
# Setting the status is enough here. The response handling path
# automatically removes content for this status code (in
# http.conditional_content_removal()).
response.status = 304
response.status_code = 304
if response.has_header('Last-Modified'):
if_modified_since = request.META.get('HTTP_IF_MODIFIED_SINCE', None)
if if_modified_since == response['Last-Modified']:
# Setting the status code is enough here (same reasons as
# above).
response.status = 304
response.status_code = 304
return response