Ticket #7228: 7228.diff
File 7228.diff, 1.3 KB (added by , 16 years ago) |
---|
-
django_src/django/middleware/common.py
108 108 if response.has_header('ETag'): 109 109 etag = response['ETag'] 110 110 else: 111 etag = md5.new(response.content).hexdigest()111 etag = '"%s"' % md5.new(response.content).hexdigest() 112 112 if response.status_code >= 200 and response.status_code < 300 and request.META.get('HTTP_IF_NONE_MATCH') == etag: 113 113 cookies = response.cookies 114 114 response = http.HttpResponseNotModified() -
django_src/django/utils/cache.py
104 104 if cache_timeout < 0: 105 105 cache_timeout = 0 # Can't have max-age negative 106 106 if not response.has_header('ETag'): 107 response['ETag'] = md5.new(response.content).hexdigest()107 response['ETag'] = '"%s"' % md5.new(response.content).hexdigest() 108 108 if not response.has_header('Last-Modified'): 109 109 response['Last-Modified'] = http_date() 110 110 if not response.has_header('Expires'):