is-url icon indicating copy to clipboard operation
is-url copied to clipboard

Allows "http://www.google" when it shouldn't

Open ghost opened this issue 7 years ago • 2 comments

The modules allows:

  • "http://www.google.com"
  • "https://www.google.com"
  • "http://google.com"
  • "http://www.google.com/imghp"
  • "http://g.co"

and disallows:

  • "www.google"
  • "google"
  • "google#.com"
  • "google-.co"

The problem is that it ALLOWS http://www.google when it shouldn't.

ghost avatar Nov 01 '18 14:11 ghost

Not sure why you consider that an invalid url? Just because it's not (yet) a registered TLD? A user/company might have that domain set up in their local network and then www.google could actually resolve (e. g. to an intranet).

I guess you can use sth like tldExists from tldjs for your use-case.

simonhaenisch avatar Feb 27 '19 09:02 simonhaenisch

It is actually a registered TLD and used (try https://dns.google/ ), so definitely not a bug.

crunchiness avatar Sep 30 '19 19:09 crunchiness