Skip to content

Commit 00c7814

Browse files
shaunpudkvesteri
authored andcommitted
Numeric domains, two numbers in length, not validated
1 parent 6399198 commit 00c7814

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎CHANGES.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ Changelog
22
---------
33

44

5+
0.10.1 (2016-04-09)
6+
^^^^^^^^^^^^^^^^^^^
7+
8+
- Fixed domain name validation for numeric domain names (#21, pull request courtesy shaunpud)
9+
10+
511
0.10.0 (2016-01-09)
612
^^^^^^^^^^^^^^^^^^^
713

‎tests/test_domain.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
'example.com',
99
'xn----gtbspbbmkef.xn--p1ai',
1010
'underscore_subdomain.example.com',
11-
'something.versicherung'
11+
'something.versicherung',
12+
'11.com'
1213
])
1314
def test_returns_true_on_valid_domain(value):
1415
assert domain(value)

‎validators/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
from .utils import ValidationFailure, validator # noqa
1414
from .uuid import uuid # noqa
1515

16-
__version__ = '0.10'
16+
__version__ = '0.10.1'

‎validators/domain.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pattern = re.compile(
66
r'^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|'
77
r'([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|'
8-
r'([a-zA-Z0-9][-_.a-zA-Z0-9]{1,61}[a-zA-Z0-9]))\.'
8+
r'([a-zA-Z0-9][-_.a-zA-Z0-9]{0,61}[a-zA-Z0-9]))\.'
99
r'([a-zA-Z]{2,13}|[a-zA-Z0-9-]{2,30}.[a-zA-Z]{2,3})$'
1010
)
1111

0 commit comments

Comments
 (0)