Django

Code

Ticket #5313: js_gzip.diff

File js_gzip.diff, 0.7 kB (added by jmelesky, 1 year ago)

updated patch

  • django/middleware/gzip.py

    old new  
    2020         
    2121        # Avoid gzipping if we've already got a content-encoding or if the 
    2222        # content-type is Javascript (silly IE...) 
    23         is_js = "javascript" in response.get('Content-Type', '').lower() 
     23        is_js = ("javascript" in response.get('Content-Type', '').lower() 
     24                 and "msie" in request.META.get('HTTP_USER_AGENT', '').lower()) 
    2425        if response.has_header('Content-Encoding') or is_js: 
    2526            return response 
    2627