JavaScript
JavaScript copied to clipboard
Validate Url Issues
Two issues found with the Validate Url algorithm:
- A string is considered to be valid URL if it starts with www. even though it does not have https
validateUrl('www.google.com')// returns truevalidateUrl('google.com')// returns false
- A valid URL returns false if starts with www like:
validateUrl('https://wwwdomain.com')// returns false
Can i try this
Can i try this
No (see the current PR).
is it still open?
Yesn't? The solution might be a removal of the "algorithm" though.
Hmm. None of those test cases are valid email addresses.
validateEmail('www.google.com') // returns true :question:
@trasherdk Oops... It's a typo. Should say validateUrl('www.google.com').
Fixed now.
Is this issue still open?
Is this issue still open?
Yes, but bear in mind that validating URLs is much more complex than presented here:
![]()
(from https://en.wikipedia.org/wiki/URL)
hello, I would like to work on this.