-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Context
- node version: 5.11.1
- joi version: 8.4.2
- environment (node, browser): Node
- used with (hapi, standalone, ...): Hapi
- any other relevant information:
What are you trying to achieve or the steps to reproduce ?
- Attempt to validate a utf-8 email address such as: jØrgen@somedomain.com
- Get 'invalid' validation result
Note that this email is considered invalid, which is correct, but permitted by https://tools.ietf.org/html/rfc6530
const schema = Joi.string().email()Which result you had ?
Email address was marked as invalid. This is a problem as I would now have to use a regexp or simple string validation for email addresses which significantly reduces readability.
What did you expect ?
I'd hope for some method of switching between RFC versions - perhaps by passing in the rfc number. I don't really have any other 'good solutions' for this.
Google, for example support sending and recieving from RFC 6530 emails, but not signing up with them - they would use something like:
const signupSchema = Joi.string().email({compliance: 'rfc5322'})
const sendingSchema = Joi.string().email({compliance: 'rfc6530'})Of course compliance could be changed to international: true/false' or something similar, but I think compliance is more explicit.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement