mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-06-25 11:45:32 +02:00
Solved portfolio bug
This commit is contained in:
parent
f748f9cef1
commit
865f3577d4
@ -126,7 +126,7 @@ class FilterModule(object):
|
|||||||
self.is_feature_enabled(applications, 'portfolio_iframe', application_id)
|
self.is_feature_enabled(applications, 'portfolio_iframe', application_id)
|
||||||
and directive == 'frame-ancestors'
|
and directive == 'frame-ancestors'
|
||||||
):
|
):
|
||||||
domain = domains.get(application_id) # e.g. "sub.example.com" or "example.com"
|
domain = domains.get('portfolio')[0] # e.g. "sub.example.com" or "example.com"
|
||||||
# Extract the second-level + top-level domain and prefix with "*."
|
# Extract the second-level + top-level domain and prefix with "*."
|
||||||
sld_tld = ".".join(domain.split(".")[-2:]) # yields "example.com"
|
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"
|
||||||
|
@ -175,7 +175,7 @@ class TestCspFilters(unittest.TestCase):
|
|||||||
# Ensure feature enabled and domain set
|
# Ensure feature enabled and domain set
|
||||||
self.apps['app1']['features']['portfolio_iframe'] = True
|
self.apps['app1']['features']['portfolio_iframe'] = True
|
||||||
# simulate a subdomain for the application
|
# simulate a subdomain for the application
|
||||||
self.domains['app1'] = 'sub.domain-example.com'
|
self.domains['portfolio'] = ['domain-example.com']
|
||||||
|
|
||||||
header = self.filter.build_csp_header(self.apps, 'app1', self.domains, web_protocol='https')
|
header = self.filter.build_csp_header(self.apps, 'app1', self.domains, web_protocol='https')
|
||||||
# Expect '*.domain-example.com' in the frame-ancestors directive
|
# Expect '*.domain-example.com' in the frame-ancestors directive
|
||||||
|
Loading…
x
Reference in New Issue
Block a user