Commit 94beaa6e authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

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
parent 6d5c868e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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