diff options
author | Justin Bronn <jbronn@gmail.com> | 2008-08-05 17:15:33 +0000 |
---|---|---|
committer | Justin Bronn <jbronn@gmail.com> | 2008-08-05 17:15:33 +0000 |
commit | aa239e3e5405933af6a29dac3cf587b59a099927 (patch) | |
tree | ea2cbd139c9a8cf84c09e0b2008bff70e05927ef /django/middleware/common.py | |
parent | 45b73c9a4685809236f84046cc7ffd32a50db958 (diff) | |
download | django-attic/gis.tar.gz |
gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.archive/attic/gisattic/gis
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@8215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/middleware/common.py')
-rw-r--r-- | django/middleware/common.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/middleware/common.py b/django/middleware/common.py index 5cb7ca1bd3..a564017ed6 100644 --- a/django/middleware/common.py +++ b/django/middleware/common.py @@ -1,4 +1,3 @@ -import md5 import re from django.conf import settings @@ -6,6 +5,7 @@ from django import http from django.core.mail import mail_managers from django.utils.http import urlquote from django.core import urlresolvers +from django.utils.hashcompat import md5_constructor class CommonMiddleware(object): """ @@ -21,7 +21,7 @@ class CommonMiddleware(object): slash, and it is not found in urlpatterns, a new URL is formed by appending a slash at the end. If this new URL is found in urlpatterns, then an HTTP-redirect is returned to this new URL; - otherwise the initial URL is processed as usual. + otherwise the initial URL is processed as usual. - ETags: If the USE_ETAGS setting is set, ETags will be calculated from the entire page content and Not Modified responses will be returned @@ -108,7 +108,7 @@ class CommonMiddleware(object): if response.has_header('ETag'): etag = response['ETag'] else: - etag = '"%s"' % md5.new(response.content).hexdigest() + etag = '"%s"' % md5_constructor(response.content).hexdigest() if response.status_code >= 200 and response.status_code < 300 and request.META.get('HTTP_IF_NONE_MATCH') == etag: cookies = response.cookies response = http.HttpResponseNotModified() |