From 63cd6149d1e3ac5a38b14906a2af787b385b2768 Mon Sep 17 00:00:00 2001 From: Brennan Date: Fri, 15 Jan 2016 16:07:10 -0800 Subject: [PATCH] Removed IsLocal from ConnectionInfo --- samples/SampleApp/Startup.cs | 1 - .../Http/Frame.FeatureCollection.cs | 2 -- src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs | 9 --------- .../RequestTests.cs | 4 +--- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/samples/SampleApp/Startup.cs b/samples/SampleApp/Startup.cs index 5ff5a14fa5..830e6283a6 100644 --- a/samples/SampleApp/Startup.cs +++ b/samples/SampleApp/Startup.cs @@ -54,7 +54,6 @@ namespace SampleApp var connectionFeature = context.Connection; Console.WriteLine($"Peer: {connectionFeature.RemoteIpAddress?.ToString()} {connectionFeature.RemotePort}"); Console.WriteLine($"Sock: {connectionFeature.LocalIpAddress?.ToString()} {connectionFeature.LocalPort}"); - Console.WriteLine($"IsLocal: {connectionFeature.IsLocal}"); context.Response.ContentLength = 11; context.Response.ContentType = "text/plain"; diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs index 22e320e72f..91aa90eb37 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.FeatureCollection.cs @@ -272,8 +272,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Http int IHttpConnectionFeature.LocalPort { get; set; } - bool IHttpConnectionFeature.IsLocal { get; set; } - object IFeatureCollection.this[Type key] { get { return FastFeatureGet(key); } diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs index f315bb702b..3ea812fd14 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs @@ -233,15 +233,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Http httpConnectionFeature.LocalIpAddress = _localEndPoint?.Address; httpConnectionFeature.LocalPort = _localEndPoint?.Port ?? 0; - if (_remoteEndPoint != null && _localEndPoint != null) - { - httpConnectionFeature.IsLocal = _remoteEndPoint.Address.Equals(_localEndPoint.Address); - } - else - { - httpConnectionFeature.IsLocal = false; - } - _prepareRequest?.Invoke(this); _manuallySetRequestAbortToken = null; diff --git a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs index fdba322cb3..1beb9fd4a5 100644 --- a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs +++ b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs @@ -145,8 +145,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests RemoteIPAddress = connection.RemoteIpAddress?.ToString(), RemotePort = connection.RemotePort, LocalIPAddress = connection.LocalIpAddress?.ToString(), - LocalPort = connection.LocalPort, - IsLocal = connection.IsLocal + LocalPort = connection.LocalPort })); }); }); @@ -165,7 +164,6 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests var facts = JsonConvert.DeserializeObject(connectionFacts); Assert.Equal(expectAddress, facts["RemoteIPAddress"].Value()); Assert.NotEmpty(facts["RemotePort"].Value()); - Assert.True(facts["IsLocal"].Value()); } } }