def normalize_host(scheme, host):
    """
    Normalize the host part of the URL
    """
    host, _, port = host.partition(':')
    if port == '80' and scheme in ('http', None):
        port = ''
    if port == '443' and scheme == 'https':
        port = ''
    if port:
        return '{0}:{1}'.format(host, port)
    return host
