In a Ruby on Rails 4 application I'm working on, I need to make a page that will be pulled into an iframe hosted on the foo.bar.com
server, so I have this controller method:
def iframed_page
response.headers["X-FRAME-OPTIONS"] = "ALLOW-FROM http://foo.bar.com"
end
..and now it turns out that the client wants me to also whitelist http://foo.dev.bar.com
as well.
I know that for setting X-FRAME-OPTIONS, the "ALLOW-FROM" option doesn't allow for multiple subdomains. But since this is the same root domain with different subdomains, would it be a little more flexible? For example, could I do something like
response.headers["X-FRAME-OPTIONS"] = "ALLOW-FROM http://*.bar.com"
as well?
Content-Security-Policy
. Regardless, it seemsX-FRAME-OPTIONS
may not be the most forward-looking choice. – RaskContent-Security-Policy
doesn't work in all browsers and that the relevant directiveframe-ancestors
only works in Chrome and Firefox. Also that answer's statements aboutX-FRAME-OPTIONS
are out of date as well. – Proctor