示例#1
0
        public void CanSetCustomFriendlyHtmlPageHeaders()
        {
            using (var octopus = new HalibutRuntime(services, Certificates.Octopus))
            {
                octopus.SetFriendlyHtmlPageHeaders(new Dictionary <string, string> {
                    { "X-Content-Type-Options", "nosniff" }, { "X-Frame-Options", "DENY" }
                });
                var listenPort = octopus.Listen();

                var result = GetHeadersIgnoringCertificateValidation("https://localhost:" + listenPort).ToList();

                result.Should().Contain(x => x.Key == "X-Content-Type-Options" && x.Value == "nosniff");
                result.Should().Contain(x => x.Key == "X-Frame-Options" && x.Value == "DENY");
            }
        }