Beispiel #1
0
 public ExpectCt(RequestDelegate next, ulong maxAge, string reportUri, bool enforce = false)
 {
     this._next = next;
     if (string.IsNullOrWhiteSpace(reportUri))
     {
         throw new ArgumentNullException(nameof(reportUri), "Report URI must have a value");
     }
     headerValue = ExpectCtHeaderBuilder.Build(maxAge, reportUri, enforce);
 }
        public void TestHeaderWithEnforce()
        {
            var result = ExpectCtHeaderBuilder.Build(0, "/awesome", true);

            Assert.Equal("max-age=0; report-uri=\"/awesome\"; enforce", result);
        }
        public void TestHeader()
        {
            var result = ExpectCtHeaderBuilder.Build(0, "/awesome");

            Assert.Equal("max-age=0; report-uri=\"/awesome\"", result);
        }
 public void TestExceptions()
 {
     Assert.Throws <ArgumentNullException>(() => ExpectCtHeaderBuilder.Build(0, string.Empty));
 }