def get_mimetype(response):
    """
    Extract MIME type from given response (usually a HEAD request), or None
    """
    try:
        return response.headers["Content-Type"]
    except:     # KeyError
        return None