Code

Ticket #16035: gzip.py.patch

File gzip.py.patch, 484 bytes (added by anonymous, 3 years ago)

Patch to gzip.py to update ETag upon gzipping

  • gzip.py

    old new  
    3232        if not re_accepts_gzip.search(ae): 
    3333            return response 
    3434 
     35        if response.has_header('ETag'): 
     36            response['ETag'] = re.sub('"$', ';gzip"', response['ETag']) 
     37 
    3538        response.content = compress_string(response.content) 
    3639        response['Content-Encoding'] = 'gzip' 
    3740        response['Content-Length'] = str(len(response.content))