mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-21 22:05:38 -04:00
Fixed: RestClient does not use global proxy settings
This commit is contained in:
@@ -17,18 +17,9 @@ namespace NzbDrone.Core.Http
|
||||
|
||||
public HttpProxySettings GetProxySettings(HttpRequest request)
|
||||
{
|
||||
if (!_configService.ProxyEnabled)
|
||||
{
|
||||
var proxySettings = GetProxySettings();
|
||||
if (proxySettings == null)
|
||||
return null;
|
||||
}
|
||||
|
||||
var proxySettings = new HttpProxySettings(_configService.ProxyType,
|
||||
_configService.ProxyHostname,
|
||||
_configService.ProxyPort,
|
||||
_configService.ProxyBypassFilter,
|
||||
_configService.ProxyBypassLocalAddresses,
|
||||
_configService.ProxyUsername,
|
||||
_configService.ProxyPassword);
|
||||
|
||||
if (ShouldProxyBeBypassed(proxySettings, request.Url))
|
||||
{
|
||||
@@ -38,6 +29,22 @@ namespace NzbDrone.Core.Http
|
||||
return proxySettings;
|
||||
}
|
||||
|
||||
public HttpProxySettings GetProxySettings()
|
||||
{
|
||||
if (!_configService.ProxyEnabled)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new HttpProxySettings(_configService.ProxyType,
|
||||
_configService.ProxyHostname,
|
||||
_configService.ProxyPort,
|
||||
_configService.ProxyBypassFilter,
|
||||
_configService.ProxyBypassLocalAddresses,
|
||||
_configService.ProxyUsername,
|
||||
_configService.ProxyPassword);
|
||||
}
|
||||
|
||||
public bool ShouldProxyBeBypassed(HttpProxySettings proxySettings, HttpUri url)
|
||||
{
|
||||
//We are utilising the WebProxy implementation here to save us having to reimplement it. This way we use Microsofts implementation
|
||||
|
||||
Reference in New Issue
Block a user