luzlab / ajv-formats-draft2019

Plugin for AJV that adds support for some of string formats adding in the draft2019 JSON Schema.
MIT License
9 stars 6 forks source link

the following shoud fail for idn-email: 'квіточка@поштаукр' #27

Open lovas-ackerdemia opened 2 months ago

lovas-ackerdemia commented 2 months ago

hello, it seems that the the format "idn-email" doesn't check, if the top-level domain is missing or should be separated by a dot

should pass: 'квіточка@пошта.укр' should fail: 'квіточка@поштаукр'

gene-hightower commented 2 months ago

I have changed my address parser to provide basic domain validation, and a relaxed check for address length. Up til now, addresses were parsed only according to the grammar in RFC-5321. Upgrade to version 1.1.0 and domains will be verified to have at least two labels, and the top-level label to have at least two octets, no label exceeds 63 octets, and that the overall domain length (as encoded for DNS lookup) does not exceed 255 octets.