mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
fix: Allow Iframes requests on portal controller (#7858)
This commit is contained in:
committed by
GitHub
parent
99bb074656
commit
a8009c7b39
@@ -1,6 +1,7 @@
|
|||||||
class Public::Api::V1::Portals::BaseController < PublicController
|
class Public::Api::V1::Portals::BaseController < PublicController
|
||||||
before_action :show_plain_layout
|
before_action :show_plain_layout
|
||||||
around_action :set_locale
|
around_action :set_locale
|
||||||
|
after_action :allow_iframe_requests
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
@@ -39,4 +40,8 @@ class Public::Api::V1::Portals::BaseController < PublicController
|
|||||||
|
|
||||||
I18n.with_locale(@locale, &)
|
I18n.with_locale(@locale, &)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def allow_iframe_requests
|
||||||
|
response.headers.delete('X-Frame-Options') if @is_plain_layout_enabled
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -37,13 +37,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="max-w-6xl p-8 mx-auto space-y-4 w-full">
|
<div class="max-w-6xl p-8 mx-auto space-y-4 w-full <%= @is_plain_layout_enabled ? 'px-8 py-4' : 'p-8' %>">
|
||||||
<%= render "public/api/v1/portals/articles/article_header", article: @article %>
|
<%= render "public/api/v1/portals/articles/article_header", article: @article %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="flex max-w-6xl w-full px-8 mx-auto">
|
<div class="flex max-w-6xl w-full px-8 mx-auto">
|
||||||
<article id="cw-article-content" class="flex-grow flex-2 py-12 mx-auto text-slate-800 text-lg max-w-3xl prose break-words">
|
<article id="cw-article-content" class="flex-grow flex-2 mx-auto text-slate-800 text-lg max-w-3xl prose break-words w-full <%= @is_plain_layout_enabled ? 'py-4' : 'py-12' %>">
|
||||||
<%= @parsed_content %>
|
<%= @parsed_content %>
|
||||||
</article>
|
</article>
|
||||||
<div class="flex-1" id="cw-hc-toc"></div>
|
<div class="flex-1" id="cw-hc-toc"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user