Ticket #8034: gzip_middleware_no_images_startswith.diff

File gzip_middleware_no_images_startswith.diff, 665 bytes (added by magneto, 16 years ago)

no vid and no images (bad diff file last time)

  • django/middleware/gzip.py

     
    1212    on the Accept-Encoding header.
    1313    """
    1414    def process_response(self, request, response):
     15        ctype = response.get('Content-Type', '').lower()
     16        if ctype and (ctype.startswith('image') or ctype.startswith('video')):
     17            return response
     18           
    1519        # It's not worth compressing non-OK or really short responses.
    1620        if response.status_code != 200 or len(response.content) < 200:
    1721            return response
Back to Top