JavaScript icon indicating copy to clipboard operation
JavaScript copied to clipboard

Validate Url Issues

Open meirroth opened this issue 3 years ago • 6 comments

Two issues found with the Validate Url algorithm:

  1. 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 true
  • validateUrl('google.com') // returns false
  1. A valid URL returns false if starts with www like:
  • validateUrl('https://wwwdomain.com') // returns false

meirroth avatar Oct 13 '22 16:10 meirroth

Can i try this

SubhamB2003 avatar Oct 16 '22 15:10 SubhamB2003

Can i try this

No (see the current PR).

appgurueu avatar Oct 16 '22 15:10 appgurueu

is it still open?

609harsh avatar Oct 19 '22 13:10 609harsh

Yesn't? The solution might be a removal of the "algorithm" though.

appgurueu avatar Oct 19 '22 15:10 appgurueu

Hmm. None of those test cases are valid email addresses.

validateEmail('www.google.com') // returns true :question:

trasherdk avatar Oct 27 '22 11:10 trasherdk

@trasherdk Oops... It's a typo. Should say validateUrl('www.google.com'). Fixed now.

meirroth avatar Oct 27 '22 20:10 meirroth

Is this issue still open?

Aditya-Naresh avatar Apr 16 '23 12:04 Aditya-Naresh

Is this issue still open?

Yes, but bear in mind that validating URLs is much more complex than presented here:

URL syntax diagram

(from https://en.wikipedia.org/wiki/URL)

appgurueu avatar Apr 16 '23 12:04 appgurueu

hello, I would like to work on this.

0-harshit-0 avatar Jul 05 '23 11:07 0-harshit-0