def normalize_prefix(prefix):
    """
    Removes slashes from a URL path prefix.

    :param str prefix:
    :rtype: str
    """
    if prefix and prefix.startswith('/'):
        prefix = prefix[1:]
    if prefix and prefix.endswith('/'):
        prefix = prefix[:-1]
    return prefix
