Пример #1
0
 public void XssProtectionSet(XssProtection protection)
 {
     _http.Header.SetupSet(a => a[Constants.XssProtection] = Constants.XssProtections[protection]).Verifiable();
     AsyncTools.RunSync(() => new Middleware.XssProtection(null, protection).Invoke(_http.ContextMock.Object));
     _http.Header.Verify();
 }
Пример #2
0
        public static IApplicationBuilder UseXssProtection(this IApplicationBuilder app, XssProtection protection)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

            return(app.UseMiddleware <Middleware.XssProtection>(protection));
        }
Пример #3
0
 public void XssProtectionMapping(XssProtection protection, string val)
 {
     Assert.Equal(val, Constants.XssProtections[protection]);
 }