-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
localhost:PORT isn't recognized as a valid url #219
Comments
@davidsonsns nice investigation. Do you open a pull request for that changes? |
@anymaniax I was opening rn 😅 plz let me know ur thots |
I am still getting this error today api - Error: ENOENT: no such file or directory, open 'C:\Users\xxx\source\repos\ABC\Sample\src\ABC.Sample.ClientApp\https:\localhost:7108\swagger\v1\swagger.json' |
I have updated this again and I think it fixes all scenarios: #1032 |
+1 still have this error |
What are the steps to reproduce this issue?
http://localhost:6001/swagger/v1/swagger.json
What happens?
validator.js doesn't recognize
localhost:${PORT}
as a valid URL and ORVAL concatenates it with the current path and throws the exception below:What were you expecting to happen?
recognize
localhost
as a valid URLAny other comments?
found a couple of PR opened on validator.js repository regarding this behavior: https://github.com/validatorjs/validator.js/issues?q=isurl+localhost
so, my guess is that we could improve it
if (isString(path) && !isUrl(path)) {
toif (isString(path) && !isUrl(path, { require_tld: false })) {
What versions are you using?
Operating System: macOS Big Sur Version 11.6
Package Version:
^6.1.1
Browser Version: …
The text was updated successfully, but these errors were encountered: