def is_html(record):
    """Return true if (detected) MIME type of a record is HTML"""
    html_types = ['text/html', 'application/xhtml+xml']
    if (('WARC-Identified-Payload-Type' in record.rec_headers) and
        (record.rec_headers['WARC-Identified-Payload-Type'] in
         html_types)):
        return True
    content_type = record.http_headers.get_header('content-type', None)
    if content_type:
        for html_type in html_types:
            if html_type in content_type:
                return True
    return False