Ticket #12788: fix_middleware_http.diff

File fix_middleware_http.diff, 1.0 KB (added by penzoil <fredericbochmann@…>, 15 years ago)
  • django/middleware/http.py

     
    1616
    1717        if response.has_header('ETag'):
    1818            if_none_match = request.META.get('HTTP_IF_NONE_MATCH', None)
    19             if if_none_match == response['ETag']:
     19            content_length = request.META.get('CONTENT_LENGTH', 0)
     20            if if_none_match == response['ETag'] and content_length != 0:
    2021                # Setting the status is enough here. The response handling path
    2122                # automatically removes content for this status code (in
    2223                # http.conditional_content_removal()).
     
    4849        warnings.warn("SetRemoteAddrFromForwardedFor has been removed. "
    4950                      "See the Django 1.1 release notes for details.",
    5051                      category=DeprecationWarning)
    51         raise MiddlewareNotUsed()
    52  No newline at end of file
     52        raise MiddlewareNotUsed()
Back to Top