Ticket #10630: MSIE-fix-in-GZipMiddleware.patch

File MSIE-fix-in-GZipMiddleware.patch, 879 bytes (added by Sebastian Noack, 16 years ago)
  • django/django/middleware/gzip.py

    diff --git a/django/django/middleware/gzip.py b/django/django/middleware/gzip.py
    index 3b84980..47f75aa 100644
    a b class GZipMiddleware(object):  
    2222        if response.has_header('Content-Encoding'):
    2323            return response
    2424
    25         # Older versions of IE have issues with gzipped pages containing either
    26         # Javascript and PDF.
     25        # MSIE have issues with gzipped respones of various content types.
    2726        if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
    2827            ctype = response.get('Content-Type', '').lower()
    29             if "javascript" in ctype or ctype == "application/pdf":
     28            if not ctype.startswith("text/") or "javascript" in ctype:
    3029                return response
    3130
    3231        ae = request.META.get('HTTP_ACCEPT_ENCODING', '')
Back to Top