mirror of
https://github.com/Justuser3310/jetwork.git
synced 2025-02-07 17:34:39 +00:00
16 lines
415 B
Python
16 lines
415 B
Python
from re import compile, sub
|
|
|
|
def domain_ok(domain):
|
|
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
|