Django

Code

Show
Ignore:
Timestamp:
02/03/08 19:40:53 (10 months ago)
Author:
mtredinnick
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/middleware/gzip.py

    r6697 r7080  
    2323            return response 
    2424 
    25         # Older versions of IE have issues with gzipped javascript. 
    26         # See http://code.djangoproject.com/ticket/2449 
    27         is_ie = "msie" in request.META.get('HTTP_USER_AGENT', '').lower() 
    28         is_js = "javascript" in response.get('Content-Type', '').lower() 
    29         if is_ie and is_js
    30             return response 
     25        # Older versions of IE have issues with gzipped pages containing either 
     26        # Javascript and PDF. 
     27        if "msie" in request.META.get('HTTP_USER_AGENT', '').lower(): 
     28            ctype = response.get('Content-Type', '').lower() 
     29            if "javascript" in ctype or ctype == "application/pdf"
     30                return response 
    3131 
    3232        ae = request.META.get('HTTP_ACCEPT_ENCODING', '')