Validator.js: IsURL fails validation for localhost with default options (require_tld = true)

Created on 24 Nov 2017  路  1Comment  路  Source: validatorjs/validator.js

IsUrl() fails validation for URLs that use localhost. This is due to the validation performed when the IsUrl option require_tld is set to true.

Example URL that fails validation:
http://localhost:3000/

Most helpful comment

Please disregard. I just found this in the changelog.
"isURL() now requires the require_tld: false option to validate localhost"
https://github.com/chriso/validator.js/issues/675

>All comments

Please disregard. I just found this in the changelog.
"isURL() now requires the require_tld: false option to validate localhost"
https://github.com/chriso/validator.js/issues/675

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Maxreglez picture Maxreglez  路  3Comments

RPDeshaies picture RPDeshaies  路  4Comments

MindRapist picture MindRapist  路  4Comments

AtomicBorg picture AtomicBorg  路  3Comments

karladler picture karladler  路  3Comments