mirror of https://github.com/Syncplay/syncplay
parent
a6b8b6d333
commit
e0dd0cf05f
|
@ -569,8 +569,15 @@ class SyncplayClient(object):
|
||||||
if self._config['trustedDomains']:
|
if self._config['trustedDomains']:
|
||||||
for entry in self._config['trustedDomains']:
|
for entry in self._config['trustedDomains']:
|
||||||
trustedDomain, _, path = entry.partition('/')
|
trustedDomain, _, path = entry.partition('/')
|
||||||
if o.hostname not in (trustedDomain, "www." + trustedDomain):
|
foundMatch = False
|
||||||
# domain does not match
|
if o.hostname in (trustedDomain, "www." + trustedDomain):
|
||||||
|
foundMatch = True
|
||||||
|
elif "*" in trustedDomain:
|
||||||
|
wildcardRegex = "^("+re.escape(trustedDomain).replace("\\*","([^.]+)")+")$"
|
||||||
|
wildcardMatch = bool(re.fullmatch(wildcardRegex, o.hostname, re.IGNORECASE))
|
||||||
|
if wildcardMatch:
|
||||||
|
foundMatch = True
|
||||||
|
if not foundMatch:
|
||||||
continue
|
continue
|
||||||
if path and not o.path.startswith('/' + path):
|
if path and not o.path.startswith('/' + path):
|
||||||
# trusted domain has a path component and it does not match
|
# trusted domain has a path component and it does not match
|
||||||
|
|
Loading…
Reference in New Issue