Optimized more CSP policies and recaptcha

This commit is contained in:
2025-05-15 19:36:46 +02:00
parent 2302cbfeb4
commit 9c65c320f9
8 changed files with 48 additions and 19 deletions

View File

@@ -113,6 +113,13 @@ class FilterModule(object):
if matomo_domain:
tokens.append(f"{web_protocol}://{matomo_domain}")
# ReCaptcha integration: allow loading scripts from Google if feature enabled
if (
self.is_feature_enabled(applications, 'recaptcha', application_id)
and directive == 'script-src'
):
tokens.append('https://www.google.com')
# whitelist
tokens += self.get_csp_whitelist(applications, application_id, directive)