Full-Stack freelance Umbraco developer in the UK.

George Phillipson - Freelance Umbraco developer

Duplicate X Frame Options Same Origin

if (!_config.SuppressXFrameOptionsHeader)
            {
                // Adding X-Frame-Options header to prevent ClickJacking. See
                // http://tools.ietf.org/html/draft-ietf-websec-x-frame-options-10
                // for more information.
                httpContext.Response.AddHeader("X-Frame-Options", "SAMEORIGIN");
            }
using System;
using System.Web.Helpers;
using System.Web.Mvc;
namespace Web.Core.Helper
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
    public sealed class SuppressXFrameOptionsHeadersAttribute : ActionFilterAttribute
    {
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            AntiForgeryConfig.SuppressXFrameOptionsHeader = true;
        }
    }
}
//BaseController
[SuppressXFrameOptionsHeaders]
    public class MasterController : Controller
    {
    }

Please enter your comment.