mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: do X-Frame-Options header removal in application controller.
Co-authored-by: Sam <sam.saffron@gmail.com>
Previous commit: f7084a4339
This commit is contained in:
@@ -43,6 +43,7 @@ class ApplicationController < ActionController::Base
|
||||
after_action :add_readonly_header
|
||||
after_action :perform_refresh_session
|
||||
after_action :dont_cache_page
|
||||
after_action :conditionally_allow_site_embedding
|
||||
|
||||
layout :set_layout
|
||||
|
||||
@@ -87,6 +88,12 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def conditionally_allow_site_embedding
|
||||
if SiteSetting.allow_embedding_site_in_an_iframe
|
||||
response.headers.delete('X-Frame-Options')
|
||||
end
|
||||
end
|
||||
|
||||
def set_layout
|
||||
case request.headers["Discourse-Render"]
|
||||
when "desktop"
|
||||
|
||||
Reference in New Issue
Block a user