Closed waynew closed 1 year ago
It doesn't validate though, parses sure, but validating with it is not good. http:////.google.com would be considered valid based on urllib.
You're right, it would, and is a valid URL:
>>> p.urlparse('http:////.google.com')
ParseResult(scheme='http', netloc='', path='//.google.com', params='', query='', fragment='')
path might not be a valid domain name, but that's an entirely different problem. Interestingly enough, http:////.google.com works fine if you type it into your address bar in Chrome, though it fails if you click that link. http:////google.com works, though.
well, technically it's wrong to place that for the 'path', google.com should be the 'netloc'? Yeah, without the period it works fine in chrome, but not in safari 😅
Well, it is the path, strictly speaking, and should be rejected because there is no netloc.
Just because it's a real URL doesn't mean you can get there from here 🤣
Awesome! Thanks for your efforts 🎉🚀👍
Python already parses URLs, and does it correctly:
I had to chase down this library because click-params uses validators to validate URLs, but totally valid URLs aren't parsed correctly because the scheme wasn't expected by this library :disappointed: