Ticket #17866: language_prefix_vary.patch

File language_prefix_vary.patch, 621 bytes (added by sero, 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):  
    4141                return HttpResponseRedirect(language_url)
    4242        translation.deactivate()
    4343
    44         patch_vary_headers(response, ('Accept-Language',))
     44        if not self.is_language_prefix_patterns_used():
     45            patch_vary_headers(response, ('Accept-Language',))
    4546        if 'Content-Language' not in response:
    4647            response['Content-Language'] = language
    4748        return response
Back to Top