i_vis/core/utils.py
def is_safe_url(target: str) -> bool:
    """Check if target url is safe.

    Check target url to prevent cross-site scripting attacks.

    Args:
        target: An url check if it is safe.

    Returns:
        True if target is safe or False otherwise.
    """
    ref_url = urlparse(request.host_url)
    test_url = urlparse(urljoin(request.host_url, target))
    return test_url.scheme in ("http", "https") and ref_url.netloc == test_url.netloc
Check if target url is safe.

    Check target url to prevent cross-site scripting attacks.

    Args:
        target: An url check if it is safe.

    Returns:
        True if target is safe or False otherwise.
    
Check if target url is safe.
Check target url to prevent cross-site scripting attacks.
Check if target url is safe . Check target url to prevent cross - site scripting attacks .
def is_safe_url(target: str) -> bool:
    ref_url = urlparse(request.host_url)
    test_url = urlparse(urljoin(request.host_url, target))
    return test_url.scheme in ("http", "https") and ref_url.netloc == test_url.netloc
def is_safe_url ( target : str ) -> bool : ref_url = urlparse ( request . host_url ) test_url = urlparse ( urljoin ( request . host_url , target ) ) return test_url . scheme in ( "http" , "https" ) and ref_url . netloc == test_url . netloc
Check if target url is safe.
Check if target url is safe .
"""Check if target url is safe.

    Check target url to prevent cross-site scripting attacks.

    Args:
        target: An url check if it is safe.

    Returns:
        True if target is safe or False otherwise.
    """
True if target is safe or False otherwise.
True if target is safe or False otherwise .
target
str
An url check if it is safe.
An url check if it is safe .