isURL('http://www.domain') returns as a valid URL
PR welcome.
Will do a pr in a while
@rubiin when taking a look at this, also look at http://www.domain.com.com.com.com, i.e
the occurrence of many instances of . in a URL.
It makes it true although I don't think if it is a valid URL.
Thinking about this again, yes, http://www.domain should be a valid URL, since you can actually have a domain like www.com, therefore it means you can still have www.<any-top-level>. As much as there is no current .domain, there's no rule that prohibits this.
Perhaps I'm mistaken, but let me know if this makes sense.
@rubiin when taking a look at this, also look at
http://www.domain.com.com.com.com, i.e
the occurrence of many instances of.in a URL.
It makes it true although I don't think if it is a validURL.
com.com is a valid domain; the rest then just become sub-domains...URL https://[email protected] validates as true.
> validator.isURL("https://[email protected]");
true
>
validator.isURL('adsf.asdf');
true
is there an option to actually check if URL responds with status 200?
@v3rron I believe ‘adsf.asdf’ is pretty much legit url. Checking if domain name is actually exists and alive is far beyond the purposes of this library, the purpose is to check if a string complies with specific rules.
While it is technically valid i believe there should be some sort of option for this?
From what I've read the organization that approves new tlds (ICANN) only approves domain every few years for a sum of $200k.
It would make sense to have an option for this such as: require_official_tld with default set to false
@Subalee -- you have a point; may be we need to re-think this... Let me here what the rest suggest.
Most helpful comment
Thinking about this again, yes,
http://www.domainshould be a valid URL, since you can actually have a domain likewww.com, therefore it means you can still havewww.<any-top-level>. As much as there is no current.domain, there's no rule that prohibits this.Perhaps I'm mistaken, but let me know if this makes sense.
com.comis a valid domain; the rest then just become sub-domains...