Skip to content

Commit

Permalink
Fix missing at sign in template
Browse files Browse the repository at this point in the history
  • Loading branch information
karendolan committed Apr 4, 2024
1 parent b69f6c6 commit 43ecb98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions recipes/configure-engage-nginx-proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
# Escape the 2 dots to use as literal dot chars in regex
engage_domain_cors_regex = public_engage_hostname_cors[/((?=.)(\w+))((?:.)(\w+)){2}\z/].gsub(/\./, "\\.")

# This is because I thought the join was the problem when doing it in the template variables below
iframe_embed_whitelist_array = get_iframe_embed_allowed_hosts
# Trying to force set iframe_embed_whitelist to something, the get should have saved it to []
iframe_embed_whitelist = iframe_embed_whitelist_array.join(" ") ? iframe_embed_whitelist_array.join(" ") : []
iframe_embed_whitelist = get_iframe_embed_allowed_hosts

ssl_info = node.fetch(:ssl, get_dummy_cert)
if cert_defined(ssl_info)
Expand Down Expand Up @@ -53,7 +50,7 @@
certificate_exists: certificate_exists,
public_engage_hostname: public_engage_hostname,
engage_domain_cors_regex: engage_domain_cors_regex,
iframe_embed_whitelist: iframe_embed_whitelist
iframe_embed_whitelist: iframe_embed_whitelist.join(" ")
})
end

Expand Down
2 changes: 1 addition & 1 deletion templates/default/engage-nginx-proxy-conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ server {
add_header Access-Control-Allow-Methods $cors_method always;
add_header Vary $cors_vary always;
add_header Access-Control-Expose-Headers $cors_expose_headers always;
add_header Content-Security-Policy "frame-ancestors 'self' <%= iframe_embed_whitelist %>;";
add_header Content-Security-Policy "frame-ancestors 'self' <%= @iframe_embed_whitelist %>;";
# -- End cors specific headers (nginx omits headers with empty value )-- #

location /static {
Expand Down

0 comments on commit 43ecb98

Please sign in to comment.