public void It_adds_slash_to_the_base_Url() { var expected = "http://www.sample.com/"; var request = new FakeHttpRequest().WithUrl("http://www.sample.com"); var httpContext = FakeHttpContext.CreateWithRequest(request); var result = UriHelpers.GetBaseUri(httpContext, SiteDefinition.Empty); Assert.Equal(expected, result.ToString()); }
public void It_sets_first_X_Forwarded_Proto_scheme() { var expected = "https://www.sample.com/"; var request = new FakeHttpRequest() .WithUrl("http://www.sample.com/") .WithHeader("X-Forwarded-Proto", "https, http"); var httpContext = FakeHttpContext.CreateWithRequest(request); var result = UriHelpers.GetBaseUri(httpContext, SiteDefinition.Empty); Assert.Equal(expected, result.ToString()); }