I spend a couple days (realy lot of time for me) to resolve this issue, but finally I found some workaround.
To be honest I have read a lot of articles about x-frame-problem, its atributes (Deny, SameOrigin, AllowsAll, AllowsFor, etc.) and I haven't found any reliable sollution for such issue. I do understend the problem of clickjacking and cross site issues of course, however, I am aware that my propoistion is not fully proper and secure, because its remove the value of header from the request.
So this is it, in Global.asax.cs:
namespace xxxx
{
public class MvcApplication : HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
private void Application_EndRequest(object sender, EventArgs e)
{
Response.Headers["X-FRAME-OPTIONS"] = string.Empty;
}
}
}
To sum up I have to admit couple of things:
Chrome browser does not support AllowFor atribute neither AllowAll. It understands only Deny and SameOrigin atribute, in the other hand Internet Explorer deal with AllowAll atribute. FireFox behaves similar to Chrome.
Also IIS or Windows Azure hosts adds automaticly this header to response with SameOrigin atribute. (the same as Somme.com host).
In such case as mine (and other people as I noticed http:// www. windows- azure.net /x-frame-options-header-is-not-changing-in-azure-web-role/ ) the only solution is to resign from x-frame-options header. Although it seems to me that webbrowsers should at least support AllowFor atribute to overcome such issue.
Thanks and best regards!
Grzegorz