Browse files

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
  • Loading branch information...
1 parent 9959401 commit e8f18643cf51d9ef22868d32060c8645b269d328 @malcolmt malcolmt committed Aug 9, 2008
Showing with 2 additions and 1 deletion.
  1. +2 −1 django/middleware/locale.py
View
3 django/middleware/locale.py
@@ -19,6 +19,7 @@ def process_request(self, request):
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

0 comments on commit e8f1864

Please sign in to comment.