generated from recursivezero/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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 FalseDescribe 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request