-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Describe the bug
During development, I want to validate localhost as a correct URL, but to do so I need to add require_tld:false.
This forces me to make require_tld variable based on the environment, since I want to check for TLDs in production environment.
I think you should check the whitelist before checking if it's a IP or FQDN here:
Line 138 in 5b04cc5
| if (!isIP(host) && !isFQDN(host, options) && (!ipv6 || !isIP(ipv6, 6))) { |
I can open a Pull request if you agree!
Additional context
Validator.js version: 13.6
Node.js version: 16
OS platform: macOS