Skip to content
Browse files

Multilingual middleware checks for Content-Type header before using it

  • Loading branch information...
1 parent 8c4f789 commit ee301e3438e22bdd0537f719b09abd62ee7ada97 @bercab committed
Showing with 1 addition and 0 deletions.
  1. +1 −0 cms/middleware/multilingual.py
View
1 cms/middleware/multilingual.py
@@ -118,6 +118,7 @@ def process_response(self, request, response):
not path.startswith(settings.STATIC_URL) and
not (getattr(settings, 'STATIC_URL', False) and path.startswith(settings.STATIC_URL)) and
response.status_code == 200 and
+ response.has_header('Content-Type') and
response._headers['content-type'][1].split(';')[0] == "text/html"):
pages_root = urllib.unquote(reverse("pages-root"))
try:

0 comments on commit ee301e3

Please sign in to comment.
Something went wrong with that request. Please try again.