Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit e8f18643cf51d9ef22868d32060c8645b269d328 1 parent 9959401
@malcolmt malcolmt authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.