Solved buggies

This commit is contained in:
2025-05-20 20:46:29 +02:00
parent 49937f6ecc
commit 9d400911f4
4 changed files with 6 additions and 7 deletions

View File

@@ -126,10 +126,9 @@ class FilterModule(object):
self.is_feature_enabled(applications, 'portfolio_iframe', application_id)
and directive == 'frame-ancestors'
):
domain = domains.get('portfolio')[0] # e.g. "sub.example.com" or "example.com"
# Extract the second-level + top-level domain and prefix with "*."
domain = domains.get('portfolio')[0]
sld_tld = ".".join(domain.split(".")[-2:]) # yields "example.com"
tokens.append(f"*.{sld_tld}") # yields "*.example.com"
tokens.append(f"{sld_tld}") # yields "*.example.com"
# whitelist
tokens += self.get_csp_whitelist(applications, application_id, directive)