예제 #1
0
        internal void SetXXssProtectionHeader(IHttpContextWrapper context, NWebsecContext nwebsecContext)
        {
            if (_handlerHelper.IsUnmanagedHandler(context) || _handlerHelper.IsStaticContentHandler(context))
            {
                return;
            }

            nwebsecContext.XXssProtection = WebConfig.SecurityHttpHeaders.XXssProtection;

            var result = _headerGenerator.CreateXXssProtectionResult(WebConfig.SecurityHttpHeaders.XXssProtection);

            _headerResultHandler.HandleHeaderResult(context, result);
        }
예제 #2
0
        public void SetXXssProtectionHeader(HttpContext context)
        {
            var config = _headerConfigurationOverrideHelper.GetXXssProtectionWithOverride(context);

            if (config == null)
            {
                return;
            }

            var oldConfig = _contextConfigurationHelper.GetXXssProtectionConfiguration(context);

            var result = _headerGenerator.CreateXXssProtectionResult(config, oldConfig);

            _headerResultHandler.HandleHeaderResult(context.Response, result);
        }