コード例 #1
0
        public void TestForwardedObfuscated()
        {
            var request = new HttpRequestMock("for=\"_gazonk\"");

            Assert.AreEqual("_gazonk", Util.IP.GetIPAddress(request));
        }
コード例 #2
0
        public void TestForwardedIPv4WithPort()
        {
            var request = new HttpRequestMock("for=192.0.2.60:443;proto=http;by=203.0.113.43");

            Assert.AreEqual("192.0.2.60", Util.IP.GetIPAddress(request));
        }
コード例 #3
0
        public void TestForwardedMultiple()
        {
            var request = new HttpRequestMock("for=192.0.2.43, for=198.51.100.17");

            Assert.AreEqual("192.0.2.43", Util.IP.GetIPAddress(request));
        }
コード例 #4
0
        public void TestForwardedIPv6()
        {
            var request = new HttpRequestMock("For=\"[2001:db8:cafe::17]:4711\"");

            Assert.AreEqual("2001:db8:cafe::17", Util.IP.GetIPAddress(request));
        }