You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Thank you for your suggestion @maxgalbu
I agree in the fact that whitelist parameter should take precedence over isIP and isFQDN checks. Feel free to open a PR !
Describe the bug
During development, I want to validate
localhost
as a correct URL, but to do so I need to addrequire_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:
validator.js/src/lib/isURL.js
Line 138 in 5b04cc5
I can open a Pull request if you agree!
Additional context
Validator.js version: 13.6
Node.js version: 16
OS platform: macOS
The text was updated successfully, but these errors were encountered: