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
This commit is contained in:
Malcolm Tredinnick 2008-08-09 15:04:45 +00:00
parent 99594011a2
commit e8f18643cf
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ class LocaleMiddleware(object):
def process_response(self, request, response): def process_response(self, request, response):
patch_vary_headers(response, ('Accept-Language',)) 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() translation.deactivate()
return response return response