Inheritance: IBaseDomainLocator
コード例 #1
0
ファイル: TenantConvention.cs プロジェクト: frapid/frapid
        public static string GetBaseDomain(HttpContextBase context, bool includeScheme)
        {
            var approved = GetSerializer();
            string domain = context.Request.Url?.DnsSafeHost;
            bool isHttps = context.Request.IsSecureConnection;

            var locator = new BaseDomainLocator(approved);
            return locator.Get(domain, isHttps, includeScheme);
        }
コード例 #2
0
        public void ShouldLocateDomainWithoutSchemeTest()
        {
            var domains = new FakeDomainSerializer();
            var locator = new BaseDomainLocator(domains);
            string domain = "www.example.com";

            string expected = "example.com";
            string result = locator.Get(domain, false, false);

            Assert.Equal(expected, result);
        }