Commit 5f477760 authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

Fixed #6480 -- Added application/pdf the list of content types we don't...

Fixed #6480 -- Added application/pdf the list of content types we don't compress when sending to Internet Explorer. Thanks, Bastien Kleineidam.


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

        # Older versions of IE have issues with gzipped javascript.
        # See http://code.djangoproject.com/ticket/2449
        is_ie = "msie" in request.META.get('HTTP_USER_AGENT', '').lower()
        is_js = "javascript" in response.get('Content-Type', '').lower()
        if is_ie and is_js:
        # Older versions of IE have issues with gzipped pages containing either
        # Javascript and PDF.
        if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
            ctype = response.get('Content-Type', '').lower()
            if "javascript" in ctype or ctype == "application/pdf":
                return response

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