config: add Matomo to the connect_src Content Security Policy

Solves Matomo connections being blocked. Fix #6949
This commit is contained in:
Pierre de La Morinerie 2022-02-15 14:20:59 +00:00
parent 9647e2b55c
commit 3276db016f

View file

@ -28,6 +28,7 @@ Rails.application.config.content_security_policy do |policy|
connect_whitelist << URI(API_ADRESSE_URL).host if API_ADRESSE_URL.present?
connect_whitelist << URI(API_EDUCATION_URL).host if API_EDUCATION_URL.present?
connect_whitelist << URI(API_GEO_URL).host if API_GEO_URL.present?
connect_whitelist << Rails.application.secrets.matomo[:host] if Rails.application.secrets.matomo[:enabled]
policy.connect_src(:self, *connect_whitelist)
# Pour tout le reste, par défaut on accepte uniquement ce qui vient de chez nous