@staticmethod
def set_protocol(url, use_tls):
    """
        Sets the protocol of the `url` according to the `use_tls`-flag
        and returns the modified `url`. Does not check whether the `url`
        given as parameter is correct.
        """
    http = 'http://'
    https = 'https://'
    if url.startswith(http):
        url = url[len(http):]
    elif url.startswith(https):
        url = url[len(https):]
    if use_tls:
        url = f'{https}{url}'
    else:
        url = f'{http}{url}'
    return url
