Skip to content

Commit 289ff53

Browse files
ehmkahkvesteri
authored andcommitted
#136 - fixed (#137)
1 parent 0693ced commit 289ff53

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/test_domain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'xn----gtbspbbmkef.xn--p1ai',
1010
'underscore_subdomain.example.com',
1111
'something.versicherung',
12+
'someThing.versicherung',
1213
'11.com',
1314
'3.cn',
1415
'a.cn',

validators/domain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
text_type = unicode
1212

1313
pattern = re.compile(
14-
r'^(?:[a-z0-9]' # First character of the domain
15-
r'(?:[a-z0-9-_]{0,61}[a-z0-9])?\.)' # Sub domain + hostname
16-
r'+[a-z0-9][a-z0-9-_]{0,61}' # First 61 characters of the gTLD
17-
r'[a-z]$' # Last character of the gTLD
14+
r'^(?:[a-zA-Z0-9]' # First character of the domain
15+
r'(?:[a-zA-Z0-9-_]{0,61}[A-Za-z0-9])?\.)' # Sub domain + hostname
16+
r'+[A-Za-z0-9][A-Za-z0-9-_]{0,61}' # First 61 characters of the gTLD
17+
r'[A-Za-z]$' # Last character of the gTLD
1818
)
1919

2020

0 commit comments

Comments
 (0)