Cannot display my rails 4 app in iframe even if 'X-Frame-Options' is 'ALLOWALL'

前端 未结 8 1688
死守一世寂寞
死守一世寂寞 2020-12-13 04:38

I am trying to test a responsive design. I am using Rails 4. I know it sets \'X-Frame-Options\' to SAME ORIGIN. So I overrided it in development.rb using

co         


        
8条回答
  •  春和景丽
    2020-12-13 05:04

    Try just to delete this header 'X-Frame-Options'. Maybe this way in controller:

    before_filter :allow_iframe_requests
    ...
    def allow_iframe_requests
      response.headers.delete('X-Frame-Options')
    end
    

提交回复
热议问题