'Get the Content-Type of the given url, using a HEAD request'

@staticmethod
def _get_content_type(url, session):

    (scheme, netloc, path, query, fragment) = urllib_parse.urlsplit(url)
    if (scheme not in ('http', 'https')):
        return ''
    resp = session.head(url, allow_redirects=True)
    resp.raise_for_status()
    return resp.headers.get('Content-Type', '')
