fix(gallery): allow pdf iframes in the PJ gallery

This commit is contained in:
Eric Leroy-Terquem 2024-04-22 20:16:07 +02:00
parent 32a2191c5c
commit 6ad6196098
No known key found for this signature in database
GPG key ID: ECE60B4C1FA2ABB3

View file

@ -32,9 +32,12 @@ Rails.application.config.content_security_policy do |policy|
connect_whitelist << Rails.application.secrets.matomo[:host] if Rails.application.secrets.matomo[:enabled]
policy.connect_src(:self, *connect_whitelist)
# Frames: allow Matomo's iframe on the /suivi page
# Frames: allow some iframes
frame_whitelist = []
# allow Matomo's iframe on the /suivi page
frame_whitelist << URI(MATOMO_IFRAME_URL).host if Rails.application.secrets.matomo[:enabled]
# allow pdf iframes in the PJ gallery
frame_whitelist << URI(DS_PROXY_URL).host if DS_PROXY_URL.present?
policy.frame_src(:self, *frame_whitelist)
# Everything else: allow us