From e8f18643cf51d9ef22868d32060c8645b269d328 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 9 Aug 2008 15:04:45 +0000 Subject: [PATCH] Fixed #8121 -- Don't override the Content-Language HTTP header in the locale middleware if it's already been set. Thanks, jcassee. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8259 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/middleware/locale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/middleware/locale.py b/django/middleware/locale.py index dd154e1280..b5e4949378 100644 --- a/django/middleware/locale.py +++ b/django/middleware/locale.py @@ -19,6 +19,7 @@ class LocaleMiddleware(object): def process_response(self, request, response): patch_vary_headers(response, ('Accept-Language',)) - response['Content-Language'] = translation.get_language() + if 'Content-Language' not in response: + response['Content-Language'] = translation.get_language() translation.deactivate() return response