def slash_join(base: str, path: str):
    """
    Join a and b with a single slash, regardless of whether they already
    contain a trailing/leading slash or neither.
    :param base: base_url
    :param path: path
    """
    if not path:
        return base
    path = path if path.endswith('/') else '{}/'.format(path)
    if base.endswith('/'):
        if path.startswith('/'):
            return base[:-1] + path
        return base + path
    if path.startswith('/'):
        return base + path
    return base + '/' + path
