-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isURL() incorrectly claims http:// is valid url #642
Comments
This is fixed in an upcoming release. |
Was this actually fixed, I am seeing this as a validURL, and I can't see how it is: validator.isURL('http://www.te'); |
validator.isURL('www.bro', { require_tld: true }) <-- WHY is this returning true. I clearly do NOT have a TLD here, yet, it is saying 'a-ok', why? |
@dsacramone see #623, #428, #429, #704 (comment).
|
I understand that I could set
require_host: true
to get the right result, but then if the test string is a relative url (/example/foo.html
), it won't validate. And I can't just||
two executions ofisURL()
to cover both cases (as suggested for a similar issue), because it will lead to an incorrect result becausehttp://
is flagged as valid in the above example:It seems like validator should recognize that passing a protocol and nothing else cannot be a valid url, even if configured for not requiring a hostname.
The text was updated successfully, but these errors were encountered: