1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

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 com.LandonKey.SocksWebProxy.Proxy;
using com.LandonKey.SocksWebProxy;
using System.Net.Sockets;
using System.Linq;
namespace NzbDrone.Common.Http.Dispatchers
{
@ -31,7 +32,14 @@ public HttpResponse GetResponse(HttpRequest request, CookieContainer cookies)
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 socksPassword = request.Proxy.Password == null ? string.Empty : request.Proxy.Password;

View File

@ -12,6 +12,8 @@ public HttpRequestProxySettings(ProxyType type, string host, int port, string fi
Port = port;
Username = username;
Password = password;
SubnetFilter = filterSubnet;
BypassLocalAddress = bypassLocalAddress;
}
public ProxyType Type { get; private set; }

View File

@ -27,7 +27,7 @@ public override HealthCheck Check()
if (_configService.ProxyEnabled)
{
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);
}