Yup: URL validation Failing for localhost

Created on 6 Mar 2020  路  2Comments  路  Source: jquense/yup

Describe the bug
Value http://localhost:8080/ return as a invalid url.

To Reproduce

const yup = require('yup');

const schema = yup.string().url();

const value = 'http://localhost:8080/'

console.log(`Testing '${value}'`, schema.isValidSync(value))

Expected behavior
This should return true.

Platform:

  • Chrome
  • Latest Version

Most helpful comment

Related: https://github.com/jquense/yup/issues/224

I'd also like localhost to be supported.

All 2 comments

Having same issue. I think it's because localhost is not handled in here https://github.com/jquense/yup/blob/master/src/string.js#L9.

Related: https://github.com/jquense/yup/issues/224

I'd also like localhost to be supported.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ScreamZ picture ScreamZ  路  4Comments

AmineIT picture AmineIT  路  3Comments

cfteric picture cfteric  路  3Comments

rigids picture rigids  路  3Comments

jgcmarins picture jgcmarins  路  4Comments