-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Validate port numbers #1346
Comments
My first thought is that this would make a better extension than addition to the core api. I honestly don't know why I think that, but there you have it. :P |
I don't think we have anything resembling the wrapping of other existing primitives, not sure I feel good about it either. |
By "wrapping other primitives", do you mean higher-level abstractions? joi has plenty of these. In fact, |
The An example being that there is a maximum length of 255 octects ( let's just call them characters because they're limited to that space ). This is reflected ( good ) in Joi:
Why would port numbers not also be included, if they are also limited by an RFC ( and industry standard )? I'm all for keeping the core fairly small, but if you're including |
Can someone submit a PR then? |
Hey @Marsup, I added this feature and I got it work, but before submitting PR I already added some other code to my master branch. If it's cleared I can submit PR for this feature also. Otherwise, If you agree I'll add this feature code to other branch and I'll submit PR. |
That would be fantastic, @veera83372. Thanks for taking the time. |
I have this in a few places...
Given that joi is most commonly used for servers (related: string().hostname()) and port numbers are a standardized and commonly used thing, I would prefer for this to be built in.
Beyond the readability and succinctness of it, I like that this would free my apps from having the
65535
constant, which people sometimes ask me about.Thoughts?
The text was updated successfully, but these errors were encountered: