From 07ba4d8b2b56721550c78a8a3f6aa8ca0997339d Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Tue, 3 Sep 2019 16:38:04 -0400 Subject: [PATCH] Modify headers to allow embed (#3935) --- app/controllers/liquid_embeds_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/liquid_embeds_controller.rb b/app/controllers/liquid_embeds_controller.rb index 63fa495df..69c21efde 100644 --- a/app/controllers/liquid_embeds_controller.rb +++ b/app/controllers/liquid_embeds_controller.rb @@ -1,7 +1,15 @@ class LiquidEmbedsController < ApplicationController before_action :set_cache_control_headers, only: %i[show] + after_action :allow_iframe, only: :show layout false + def show set_surrogate_key_header params.to_s end + + private + + def allow_iframe + response.headers.except! "X-Frame-Options" + end end