Пример #1
0
        public void NoSniff_ContentTypeOptionsHeader_Has_Correct_Value()
        {
            var builder = new HeaderPolicyBuilder();

            builder.AddContentTypeOptionsNoSniff();
            var headerPolicy = builder.Build();

            Assert.Single(headerPolicy.SetHeaders);
            Assert.Equal(ContentTypeOptionsHeader.NoSniff, headerPolicy.SetHeaders.Single().Value.Value);
        }
Пример #2
0
 public static IApplicationBuilder UseCustomHeaders(this IApplicationBuilder app, HeaderPolicyBuilder builder)
 => app.UseMiddleware <HeaderMiddleware>(builder.Build());