-
-
Notifications
You must be signed in to change notification settings - Fork 876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Url validation failed #481
Comments
@gajus does it not allow hash fragment? @velocityzen you can use "uri" as an alternative, "url" is an additional format. |
It does. The issue here is "localhost". The current regex does not allow TLD-less domains. Ideally, this should be a configurable option. |
@gajus Thank you. Should it allow? Or not really? |
See the note at:
– https://mathiasbynens.be/demo/url-regex I'd say it shouldn't. In most cases it would produce unexpected result. It could even be used as an attack vector. I'd recommend that in the case user requires non-public URLs (such localhost, date URIs, tel, skype, etc.) it should be implemented in the user-space. |
There is "uri" format for that. Thank you, it's all ok then. |
What version of Ajv are you using? Does the issue happen if you use the latest version?
[email protected]
Ajv options object
JSON Schema
Sample data
'https://localhost:3000/#test'
Your code
Validation result, data AFTER validation, error messages
What results did you expect?
It is a correct URL
Are you going to resolve the issue?
nope
The text was updated successfully, but these errors were encountered: