Skip to content

Instantly share code, notes, and snippets.

@sebnilsson
Created September 30, 2014 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebnilsson/81e092518aa5bd8a6751 to your computer and use it in GitHub Desktop.
Save sebnilsson/81e092518aa5bd8a6751 to your computer and use it in GitHub Desktop.
ASP.NET MVC: X-Frame-Options ALLOWALL
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class SuppressXFrameOptionsHeaderAttribute : ActionFilterAttribute
{
public override void OnResultExecuted(ResultExecutedContext filterContext)
{
filterContext.HttpContext.Response.Headers.Set("X-Frame-Options", "ALLOWALL");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment