Ticket #17866: language_prefix_vary.patch
File language_prefix_vary.patch, 621 bytes (added by , 13 years ago) |
---|
-
django/middleware/locale.py
diff --git a/django/middleware/locale.py b/django/middleware/locale.py index 628782b..e5cc462 100644
a b class LocaleMiddleware(object): 41 41 return HttpResponseRedirect(language_url) 42 42 translation.deactivate() 43 43 44 patch_vary_headers(response, ('Accept-Language',)) 44 if not self.is_language_prefix_patterns_used(): 45 patch_vary_headers(response, ('Accept-Language',)) 45 46 if 'Content-Language' not in response: 46 47 response['Content-Language'] = language 47 48 return response