From a8009c7b39ad95af0be30c255c8b4e65da43f244 Mon Sep 17 00:00:00 2001 From: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:25:03 +0530 Subject: [PATCH] fix: Allow Iframes requests on portal controller (#7858) --- app/controllers/public/api/v1/portals/base_controller.rb | 5 +++++ app/views/public/api/v1/portals/articles/show.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/public/api/v1/portals/base_controller.rb b/app/controllers/public/api/v1/portals/base_controller.rb index 851b8c549..68619baf8 100644 --- a/app/controllers/public/api/v1/portals/base_controller.rb +++ b/app/controllers/public/api/v1/portals/base_controller.rb @@ -1,6 +1,7 @@ class Public::Api::V1::Portals::BaseController < PublicController before_action :show_plain_layout around_action :set_locale + after_action :allow_iframe_requests private @@ -39,4 +40,8 @@ class Public::Api::V1::Portals::BaseController < PublicController I18n.with_locale(@locale, &) end + + def allow_iframe_requests + response.headers.delete('X-Frame-Options') if @is_plain_layout_enabled + end end diff --git a/app/views/public/api/v1/portals/articles/show.html.erb b/app/views/public/api/v1/portals/articles/show.html.erb index 62e05a900..9423c42e5 100644 --- a/app/views/public/api/v1/portals/articles/show.html.erb +++ b/app/views/public/api/v1/portals/articles/show.html.erb @@ -37,13 +37,13 @@ <% else %> -