| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
are you taking any new suggestions? |
|
Constructive ones, please go ahead. |
|
--- # Define a list of valid URI schemes => VALID_SCHEMES = ['http', 'https', 'ftp', 'mailto', 'file']
|
|
is it something we should do? |
|
Something similar yeah. |
|
can I take up the challenge :)? |
|
Sure, go ahead. |
|
Hey @yozachar ,can we use socket.inet_aton(ip) in python to validate ip addresses as a function then update the schema in uri.py? # URL-based schemes
if any(
value.startswith(item + "://") for item in {
"ftp", "ftps", "git", "http", "https",
"irc", "rtmp", "rtmps", "rtsp", "sftp",
"ssh", "telnet", "gopher", "ldap", "sip",
"nfs", "mqtt", "smb", "udp"
}
):
|
|
IP addresses are already validated in ip_address.py. Why use socket.inet_aton? |
|
Hi, that is cool I looked at the message thread, something about this error below , was why I thought this feature was asked for I guess, see code below. import validators streamurl = "rtmp://192.168.1.123:1935/live/test" print(validators.url(streamurl)) Output: Or does it mean we just want to validate other schemas? like the ones few ones below, that I could not find in uri.py proposed schemas "Uri": {
"udp": udp://192.168.1.1:1234/path;param=value?,
"gopher": gopher://gopher.example.com/1/path;type=1?search#frag,\
"ldap": ldap://ldap.example.com/cn=John%20Doe,dc=example,dc=com;scope=one?sn#frag, \
"sip":sip://user:password@sip.example.com/path;transport=tcp?subject=Hello#frag, \
"smb": smb://fileserver.example.com/share/path;param=value?query=1#fragment\
}
Few Thoughts
# Validate using regex for URL-based schemes
if uri_regex.match(value):
return True
|
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
{{editor}}'s edit
{{editor}}'s edit
Uh oh!
There was an error while loading. Please reload this page.
Suggestions are welcome:
validators/src/validators/uri.py
Lines 24 to 41 in cdc987d