vuelidate icon indicating copy to clipboard operation
vuelidate copied to clipboard

url validator only allows hostnames with TLD or internal IP (was: url validator only allows hostnames with TLD)

Open alex3683 opened this issue 7 years ago • 1 comments

The builtin url validator always assumes a valid URL to have a top-level-domain (TLD). While this is the case for hosts in the internet, it is very common to have host names without TLD in an intranet. Taking the original RFCs into account, this would also be correct (RFC 1738 for URLs references RFC 1034 regarding valid domain names).

Fiddle: https://jsfiddle.net/b5v4faqf/2897/ When viewing the fiddle, just look at the output value of url. It's true for the URL with TLD and false for the one without.

EDIT: I just tried an IP address from our LAN instead of a host name and it wasn't accepted as well. Here is an updated fiddle: https://jsfiddle.net/b5v4faqf/2898/

alex3683 avatar May 22 '18 11:05 alex3683

+1 on this one... Considering this is from 2018, is this ever going to be improved?

doutatsu avatar Nov 23 '21 18:11 doutatsu