Ticket #12789: django-12789.patch

File django-12789.patch, 612 bytes (added by Forest Bond, 14 years ago)

Patch fixing patch_response_headers.

  • django/utils/cache.py

    === modified file 'django/utils/cache.py'
     
    101101        cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS
    102102    if cache_timeout < 0:
    103103        cache_timeout = 0 # Can't have max-age negative
    104     if not response.has_header('ETag'):
     104    if 200 <= response.status_code < 300 and not response.has_header('ETag'):
    105105        response['ETag'] = '"%s"' % md5_constructor(response.content).hexdigest()
    106106    if not response.has_header('Last-Modified'):
    107107        response['Last-Modified'] = http_date()
Back to Top