Ticket #2449: gzip.diff

File gzip.diff, 532 bytes (added by James Bennett, 18 years ago)

Patch to make GZipMiddleware smarter about JavaScript

  • gzip.py

     
    1212    """
    1313    def process_response(self, request, response):
    1414        patch_vary_headers(response, ('Accept-Encoding',))
    15         if response.has_header('Content-Encoding'):
     15        if response.has_header('Content-Encoding') or response.headers['Content-Type'].endswith('javascript'):
    1616            return response
    1717
    1818        ae = request.META.get('HTTP_ACCEPT_ENCODING', '')
Back to Top