Skip to content

Commit 726e4f4

Browse files
author
Matt Oakley
committed
Reimplement frame_ancestors proc to fix tests
@sle-c has pointed out that the tests rely on the proc and suggests reimplemeting the proc and returning an array. This patch implements the recommendation and achieves the same result.
1 parent 0f2a3b3 commit 726e4f4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/shopify_app/controller_concerns/frame_ancestors.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ module FrameAncestors
66

77
included do
88
content_security_policy do |policy|
9-
domain_host = current_shopify_domain || "*.#{::ShopifyApp.configuration.myshopify_domain}"
10-
policy.frame_ancestors "#{ShopifyAPI::Context.host_scheme}://#{domain_host}", "https://admin.#{::ShopifyApp.configuration.unified_admin_domain}"
9+
policy.frame_ancestors(-> do
10+
domain_host = current_shopify_domain || "*.#{::ShopifyApp.configuration.myshopify_domain}"
11+
[
12+
"#{ShopifyAPI::Context.host_scheme}://#{domain_host}",
13+
"https://admin.#{::ShopifyApp.configuration.unified_admin_domain}",
14+
]
15+
end)
1116
end
1217
end
1318
end

0 commit comments

Comments
 (0)