Ticket #5313: js_gzip.2.diff

File js_gzip.2.diff, 671 bytes (added by jmelesky, 8 years ago)

against [6332]

  • django/middleware/gzip.py

     
    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 = ("msie" in request.META.get('HTTP_USER_AGENT', '').lower()
     24                 and "javascript" in response.get('Content-Type', '').lower())
    2425        if response.has_header('Content-Encoding') or is_js:
    2526            return response
    2627
Back to Top