4 ms·
Regarding that testdata, what is the reason for rejecting bare IP literals on the right hand side? It seems pedantic to require the square braces.
by honkhonkpants 10y ago
Regarding that testdata, what is the reason for rejecting bare IP literals on the right hand side? It seems pedantic to require the square braces.
- tedmiston 10y agoThat part is confusing to me. I ran a fresh install of Django to confirm and it behaves as you suggest. Edit: Perhaps only for low digits. Hmm. >>> from django.core.validators import EmailValidator >>> e = EmailValidator() >>> e.__call__('foo@[1.2.3.4]') >>> e.__call__('foo@1.2.3.4') ValidationError: [u'Enter a valid email address.'] >>> e.__call__('foo@0.0.0.0') ValidationError: [u'Enter a valid email address.'] >>> e.__call__('foo@[0.0.0.0]') >>> e.__call__('foo@10.10.10.10') >>> e.__call__('foo@[10.10.10.10]') >>> e.__call__('foo@255.255.255.255') >>> e.__call__('foo@[255.255.255.255]')
- honkhonkpants 10y agoHuh. "Well tested" indeed.
- Senji 10y agoYou shouldn't be accepting raw ips for e-mail anyway.