You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
415 B

from re import compile, sub
def domain_ok(domain):
9 months ago
domains = ["jet", "jw", "404", "dash", "awesome", "mirror"]
if domain.count(".") == 1:
if domain.split(".")[1] in domains:
# ../some => some
# Защита от проверки папок выше, чем нужно и др.
regex = compile('[^a-z.-]')
c_domain = regex.sub('', domain)
if domain == c_domain:
return domain
return False