Code

Ticket #8121: 8121-r8137.diff

File 8121-r8137.diff, 575 bytes (added by jcassee, 6 years ago)
Line 
1Index: django/middleware/locale.py
2===================================================================
3--- django/middleware/locale.py (revision 8137)
4+++ django/middleware/locale.py (working copy)
5@@ -19,6 +19,7 @@
6 
7     def process_response(self, request, response):
8         patch_vary_headers(response, ('Accept-Language',))
9-        response['Content-Language'] = translation.get_language()
10+        if 'Content-Language' not in response:
11+            response['Content-Language'] = translation.get_language()
12         translation.deactivate()
13         return response