public void TestHttpRequestGetServerUri()
        {
            // Bad: No headers and nothing in settings
            var settings = new MorphicSettings()
            {
                ServerUrlPrefix = ""
            };
            var request = new MockHttpRequest();

            request.Headers.Add("foo1", "something1");
            request.Headers.Add("foo2", "something2");
            var uri = request.GetServerUri();

            Assert.Null(uri);

            // GOOD: headers, but no setting: server URL comes from headers
            request = new MockHttpRequest();
            request.Headers.Add("x-forwarded-host", "myhost.example.com");
            request.Headers.Add("x-forwarded-proto", "https");
            request.Headers.Add("x-forwarded-port", "12345");
            uri = request.GetServerUri();
            Assert.Equal("https://myhost.example.com:12345/", uri.ToString());

            // No port from headers
            request = new MockHttpRequest();
            request.Headers.Add("x-forwarded-host", "myhost.example.com");
            request.Headers.Add("x-forwarded-proto", "https");
            uri = request.GetServerUri();
            Assert.Equal("https://myhost.example.com/", uri.ToString());

            // Standard ports from headers
            request = new MockHttpRequest();
            request.Headers.Add("x-forwarded-host", "myhost.example.com");
            request.Headers.Add("x-forwarded-proto", "https");
            request.Headers.Add("x-forwarded-port", "443");
            uri = request.GetServerUri();
            Assert.Equal("https://myhost.example.com/", uri.ToString());

            request = new MockHttpRequest();
            request.Headers.Add("x-forwarded-host", "myhost.example.com");
            request.Headers.Add("x-forwarded-proto", "http");
            request.Headers.Add("x-forwarded-port", "80");
            uri = request.GetServerUri();
            Assert.Equal("http://myhost.example.com/", uri.ToString());
        }