def METHOD_NAME(cls, val: str) -> str:
    # Tokenize the web url
    url = urlparse(val)
    if url.scheme not in ["http", "https"]:
        raise ConfigurationError(
            f"Scheme should be http or https, found {url.scheme}"
        )
    if not _is_valid_hostname(url.hostname.__str__()):
        raise ConfigurationError(
            f"Not a valid hostname, hostname contains invalid characters, found {url.hostname}"
        )
    return config_clean.remove_trailing_slashes(val)