From 3f5bb5fa5394ac20586160f78d02687b66f8342e Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Sun, 9 Oct 2005 10:57:05 +0000 Subject: [PATCH] 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 --- django/middleware/locale.py | 5 +++++ 1 file changed, 5 insertions(+) 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 +