Ticket #12789: fix_middleware_http.diff
File fix_middleware_http.diff, 1.0 KB (added by , 15 years ago) |
---|
-
django/middleware/http.py
16 16 17 17 if response.has_header('ETag'): 18 18 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: 20 21 # Setting the status is enough here. The response handling path 21 22 # automatically removes content for this status code (in 22 23 # http.conditional_content_removal()). … … 48 49 warnings.warn("SetRemoteAddrFromForwardedFor has been removed. " 49 50 "See the Django 1.1 release notes for details.", 50 51 category=DeprecationWarning) 51 raise MiddlewareNotUsed() 52 No newline at end of file 52 raise MiddlewareNotUsed()