Exemple #1
0
        public void Build_AddSameOriginAllowPopups_WithReportEndpoint_AddsValue()
        {
            var builder = new CrossOriginOpenerPolicyBuilder();

            builder.SameOriginAllowPopups();
            builder.AddReport().To("default");

            var result = builder.Build();

            result.ConstantValue.Should().Be("same-origin-allow-popups; report-to=\"default\"");
        }
Exemple #2
0
        public void Build_AddUnsafeNone_WithReportEndpoint_AddsValue()
        {
            var builder = new CrossOriginOpenerPolicyBuilder();

            builder.UnsafeNone();
            builder.AddReport().To("default");

            var result = builder.Build();

            result.ConstantValue.Should().Be("unsafe-none; report-to=\"default\"");
        }