Skip to content

❇️ [RTY-260032]: Handle Invalid and Valid urls #32

Description

@recursivezero

Is your feature request related to a problem? Please describe.
When we pass any invalid urls then I should check and display mesage that it's invalid

Also some Server Side URLS does not have query parama but it's still valid , that also need to check

Describe the solution you'd like

instead of checking through Validators library use

from urllib.parse import urlparse

def is_valid_url(url: str) -> bool:
    try:
        parsed = urlparse(url)
        return parsed.scheme in ("http", "https") and bool(parsed.netloc)
    except Exception:
        return False

Describe alternatives you've considered
Also check for all variations of valid URLS

Additional context

Example of valid URL: https://www.mea.gov.in/Speeches-Statements.htm?dtl/40844

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions