Bug Fixes

This commit is contained in:
Lloyd Sparkes 2016-04-24 16:56:31 +01:00
parent 6fdbb2b659
commit d68abc746c
3 changed files with 12 additions and 2 deletions

View File

@ -4,6 +4,7 @@ using NzbDrone.Common.Extensions;
using com.LandonKey.SocksWebProxy.Proxy; using com.LandonKey.SocksWebProxy.Proxy;
using com.LandonKey.SocksWebProxy; using com.LandonKey.SocksWebProxy;
using System.Net.Sockets; using System.Net.Sockets;
using System.Linq;
namespace NzbDrone.Common.Http.Dispatchers namespace NzbDrone.Common.Http.Dispatchers
{ {
@ -31,7 +32,14 @@ namespace NzbDrone.Common.Http.Dispatchers
if (request.Proxy != null && !request.Proxy.ShouldProxyBeBypassed(new Uri(request.Url.FullUri))) if (request.Proxy != null && !request.Proxy.ShouldProxyBeBypassed(new Uri(request.Url.FullUri)))
{ {
var addresses = Dns.GetHostAddresses(request.Proxy.Host); var proxyHost = request.Proxy.Host;
if(request.Proxy.Host == "localhost")
{
proxyHost = "127.0.0.1";
}
var addresses = Dns.GetHostAddresses(proxyHost);
var socksUsername = request.Proxy.Username == null ? string.Empty : request.Proxy.Username; var socksUsername = request.Proxy.Username == null ? string.Empty : request.Proxy.Username;
var socksPassword = request.Proxy.Password == null ? string.Empty : request.Proxy.Password; var socksPassword = request.Proxy.Password == null ? string.Empty : request.Proxy.Password;

View File

@ -12,6 +12,8 @@ namespace NzbDrone.Common.Http
Port = port; Port = port;
Username = username; Username = username;
Password = password; Password = password;
SubnetFilter = filterSubnet;
BypassLocalAddress = bypassLocalAddress;
} }
public ProxyType Type { get; private set; } public ProxyType Type { get; private set; }

View File

@ -27,7 +27,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
if (_configService.ProxyEnabled) if (_configService.ProxyEnabled)
{ {
var addresses = Dns.GetHostAddresses(_configService.ProxyHostname); var addresses = Dns.GetHostAddresses(_configService.ProxyHostname);
if(addresses.Length != 1) if(!addresses.Any())
{ {
return new HealthCheck(GetType(), HealthCheckResult.Error, "Failed to resolve the IP Address for the Configured Proxy Host: " + _configService.ProxyHostname); return new HealthCheck(GetType(), HealthCheckResult.Error, "Failed to resolve the IP Address for the Configured Proxy Host: " + _configService.ProxyHostname);
} }