Commit 499a8ac3 authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

Fixed #10630 -- Be even more conservative in GZipMiddleware for IE.

Patch from sebastien_noack.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10541 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 87e69393
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -22,11 +22,10 @@ class GZipMiddleware(object):
        if response.has_header('Content-Encoding'):
            return response

        # Older versions of IE have issues with gzipped pages containing either
        # Javascript and PDF.
        # MSIE have issues with gzipped respones of various content types.
        if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
            ctype = response.get('Content-Type', '').lower()
            if "javascript" in ctype or ctype == "application/pdf":
            if not ctype.startswith("text/") or "javascript" in ctype:
                return response

        ae = request.META.get('HTTP_ACCEPT_ENCODING', '')