mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user