summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-10-09 10:57:05 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-10-09 10:57:05 +0000
commit3f5bb5fa5394ac20586160f78d02687b66f8342e (patch)
treedbbc809edf5e6b1103ab0b5c1d032bbb25e65c8f
parenteb7ebb777cc0f285a2df8e357c30cd49af446e13 (diff)
i18n: I18NMiddleware now patches the Vary response header
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/middleware/locale.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/middleware/locale.py b/django/middleware/locale.py
index 35128f7376..76d026f9f7 100644
--- a/django/middleware/locale.py
+++ b/django/middleware/locale.py
@@ -1,5 +1,6 @@
"this is the locale selecting middleware that will look at accept headers"
+from django.utils.cache import patch_vary_headers
from django.utils import translation
# this is a cache that will build a map from modules to applications
@@ -38,3 +39,7 @@ class LocaleMiddleware:
translation.activate(app, lang)
+ def process_response(self, request, response):
+ patch_vary_headers(response, ('Accept-Language',))
+ return response
+