Fixed: RestClient does not use global proxy settings

Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
Qstick
2020-09-07 01:10:39 -04:00
parent bb66af7185
commit 7e00dd731c
10 changed files with 70 additions and 23 deletions
@@ -23,10 +23,12 @@ namespace NzbDrone.Core.Notifications.PushBullet
{
private const string PUSH_URL = "https://api.pushbullet.com/v2/pushes";
private const string DEVICE_URL = "https://api.pushbullet.com/v2/devices";
private readonly IRestClientFactory _restClientFactory;
private readonly Logger _logger;
public PushBulletProxy(Logger logger)
public PushBulletProxy(IRestClientFactory restClientFactory, Logger logger)
{
_restClientFactory = restClientFactory;
_logger = logger;
}
@@ -96,7 +98,7 @@ namespace NzbDrone.Core.Notifications.PushBullet
{
try
{
var client = RestClientFactory.BuildClient(DEVICE_URL);
var client = _restClientFactory.BuildClient(DEVICE_URL);
var request = new RestRequest(Method.GET);
client.Authenticator = new HttpBasicAuthenticator(settings.ApiKey, string.Empty);
@@ -174,7 +176,7 @@ namespace NzbDrone.Core.Notifications.PushBullet
{
try
{
var client = RestClientFactory.BuildClient(PUSH_URL);
var client = _restClientFactory.BuildClient(PUSH_URL);
request.AddParameter("type", "note");
request.AddParameter("title", title);