Skip to content

Commit fdeab02

Browse files
committed
Merge pull request code-dot-org#5440 from code-dot-org/dynamic_iframe_whitelist
Allow allowed_iframe_ancestors to be defined in DCDO or CDO
2 parents f7e491d + 26e737d commit fdeab02

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/cdo/rack/upgrade_insecure_requests.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ def call(env)
5151
]
5252
end
5353

54-
# If the CDO.allowed_iframe_ancestors configuration variable is
54+
# If the DCDO or CDO allowed_iframe_ancestors configuration variable is
5555
# defined, override the default SAMEORIGIN policy to allow the
5656
# specified source list (as described in
5757
# http://w3c.github.io/webappsec-csp/#source-lists) to frame our
5858
# content.
59-
if CDO.allowed_iframe_ancestors
60-
policies << "frame-ancestors 'self' #{CDO.allowed_iframe_ancestors}"
59+
allowed_iframe_ancestors = DCDO.get('allowed_iframe_ancestors', nil) || CDO.allowed_iframe_ancestors
60+
if allowed_iframe_ancestors
61+
policies << "frame-ancestors 'self' #{allowed_iframe_ancestors}"
6162

6263
# Clear the older X-Frame-Options header because it doesn't support
6364
# multiple domains. We need to clear this because on Chrome,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy