def _extract_etag(response):
    ''' Extracts the etag from the response headers. '''
    if response and response.headers:
        for name, value in response.headers:
            if name.lower() == 'etag':
                return value

    return None