'If the content-length header is present, calculate the new len and
update the header.'

def _fix_content_len(self, response):

    cl = 'Content-Length'
    for i in response.get_headers():
        if (i.lower() == 'content-length'):
            cl = i
            break
    headers = response.get_headers()
    headers[cl] = str(len(response.get_body()))
    response.set_headers(headers)
    return response
