FEATURE: add site setting to remove X-Frame-Options header.

This commit is contained in:
Vinoth Kannan
2019-12-06 03:15:09 +05:30
parent 00985559e4
commit f7084a4339
5 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
module Middleware
class FrameOptions
def initialize(app, settings = {})
@app = app
end
def call(env)
status, headers, body = @app.call(env)
headers.except!('X-Frame-Options') if SiteSetting.allow_embedding_site_in_an_iframe
[status, headers, body]
end
end
end