Merge pull request #472 from metamaps/feature/allow-embedding

allow embedding
This commit is contained in:
Devin Howard 2016-02-21 15:19:54 +08:00
commit bd6a5ee9c4

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