allow embedding

This commit is contained in:
Devin Howard 2016-02-19 09:23:39 +08:00
parent 5dc32186e8
commit 7b9c6459e3

View file

@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :get_invite_link
after_action :allow_embedding
# this is for global login
include ContentHelper
@ -69,4 +70,11 @@ private
safe_uri = (unsafe_uri.match(valid_url)) ? unsafe_uri : '//metamaps.cc/'
@invite_link = "#{safe_uri}join" + (current_user ? "?code=#{current_user.code}" : "")
end
def allow_embedding
#allow all
response.headers.except! 'X-Frame-Options'
# or allow a whitelist
# response.headers['X-Frame-Options'] = 'ALLOW-FROM http://blog.metamaps.cc'
end
end