Open mjancarik opened 3 years ago
I was going to submit a PR to fix this, but then I saw these tests... https://github.com/validatorjs/validator.js/blob/907bb07b8d6be7d159791645960eb5f5017a99b6/test/validators.js#L672-L688
It seems that you can set the disallow_auth
option to true
and it will fail validation on an email.
Hi,
Thank you. I will try it. I would expect default behaviour with disallow_auth
to true
.
@ezkemboi can i work on this issue
@raghavbk if you have a PR, please do it and we will review it. Thanks.
@mjancarik Buddy can you tell one thing
user@example.com : This will treated as an email due to the presence of " @ " in it , so I think its bound to return true to this
In no way is an email address a URL, as someone claimed in an issue.
mailto:xyz@xyz.net
is a URL/URI, but xyz@xyz.net
is not. This should be considered a bug.
Well, till someone figure out which way is the correct way, doing this works for everyone else:
validator.isURL('xyz@xyz.net', { disallow_auth: true }); // false
Describe the bug Hi,
What is the correct behaviour for
isURL
function when I give e-mail address? I would expect that return false.Examples An example from the Node REPL:
Additional context Validator.js version: 13.6.0 Node.js version: 14.16.0 OS platform: macOS