diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-09-03 03:29:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-03 03:29:18 -0400 |
| commit | 9cf5cd1e5b504619875be6c5b9e4d76a990686e7 (patch) | |
| tree | d6f6b236ac4da21746a9f3d7ce0cbe8b33761434 /SocketHttpListener/Net/HttpListenerRequest.cs | |
| parent | fd62146e464a35993afbd9f277c01eee2c3d4f51 (diff) | |
| parent | 2084678266e7e65dde077fc2caee63c0051bf3db (diff) | |
Merge pull request #2862 from MediaBrowser/dev
Dev
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); - } } } |
