diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-09-20 13:22:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-20 13:22:39 -0400 |
| commit | eb2a1330045d802bfe0366df7105c220a36f111f (patch) | |
| tree | 2c1638c424ee9c0837c5de6d6e08a2398da69cdb /SocketHttpListener/Net/HttpListenerRequest.cs | |
| parent | ec426d5c92875639ceac64477ce10fab3e639335 (diff) | |
| parent | a015e1208885bc6a8788db683c4fe47e93dc26b7 (diff) | |
Merge pull request #2897 from MediaBrowser/beta
Beta
Diffstat (limited to 'SocketHttpListener/Net/HttpListenerRequest.cs')
| -rw-r--r-- | SocketHttpListener/Net/HttpListenerRequest.cs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/SocketHttpListener/Net/HttpListenerRequest.cs b/SocketHttpListener/Net/HttpListenerRequest.cs index f9df52593..5e391424f 100644 --- a/SocketHttpListener/Net/HttpListenerRequest.cs +++ b/SocketHttpListener/Net/HttpListenerRequest.cs @@ -3,6 +3,7 @@ using System.Collections.Specialized; using System.Globalization; using System.IO; using System.Net; +using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading.Tasks; using MediaBrowser.Model.Net; @@ -513,7 +514,14 @@ namespace SocketHttpListener.Net public bool IsLocal { - get { return RemoteEndPoint.IpAddress.Equals(IpAddressInfo.Loopback) || RemoteEndPoint.IpAddress.Equals(IpAddressInfo.IPv6Loopback) || LocalEndPoint.IpAddress.Equals(RemoteEndPoint.IpAddress); } + get + { + var remoteEndPoint = RemoteEndPoint; + + return remoteEndPoint.Address.Equals(IPAddress.Loopback) || + remoteEndPoint.Address.Equals(IPAddress.IPv6Loopback) || + LocalEndPoint.Address.Equals(remoteEndPoint.Address); + } } public bool IsSecureConnection @@ -557,7 +565,7 @@ namespace SocketHttpListener.Net } } - public IpEndPointInfo LocalEndPoint + public IPEndPoint LocalEndPoint { get { return context.Connection.LocalEndPoint; } } @@ -577,7 +585,7 @@ namespace SocketHttpListener.Net get { return raw_url; } } - public IpEndPointInfo RemoteEndPoint + public IPEndPoint RemoteEndPoint { get { return context.Connection.RemoteEndPoint; } } @@ -651,10 +659,5 @@ namespace SocketHttpListener.Net return _websocketRequest; } } - - public Task<ICertificate> GetClientCertificateAsync() - { - return Task.FromResult<ICertificate>(null); - } } } |
