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(); }
public static IApplicationBuilder UseXssProtection(this IApplicationBuilder app, XssProtection protection) { if (app == null) { throw new ArgumentNullException(nameof(app)); } return(app.UseMiddleware <Middleware.XssProtection>(protection)); }
public void XssProtectionMapping(XssProtection protection, string val) { Assert.Equal(val, Constants.XssProtections[protection]); }