diff --git a/django/middleware/common.py b/django/middleware/common.py index 85703d2a0b..5f671dff7d 100644 --- a/django/middleware/common.py +++ b/django/middleware/common.py @@ -75,7 +75,7 @@ class CommonMiddleware(object): # Use ETags, if requested. if settings.USE_ETAGS: etag = md5.new(response.content).hexdigest() - if response.status_code >= 200 and response.status_code < 300 and response.statusrequest.META.get('HTTP_IF_NONE_MATCH') == etag: + if response.status_code >= 200 and response.status_code < 300 and request.META.get('HTTP_IF_NONE_MATCH') == etag: response = http.HttpResponseNotModified() else: response['ETag'] = etag