1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-25 22:46:31 -04:00

New: Add authentication options to Webhook

Closes #2257
This commit is contained in:
Frank Scholl
2017-11-01 00:28:51 -04:00
committed by Mark McDowall
parent 3d8cd9616e
commit 442d49046d
3 changed files with 20 additions and 2 deletions
@@ -1,6 +1,7 @@
using NzbDrone.Common.Http;
using NzbDrone.Common.Http;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Rest;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.Notifications.Webhook
{
@@ -30,6 +31,10 @@ namespace NzbDrone.Core.Notifications.Webhook
request.Headers.ContentType = "application/json";
request.SetContent(body.ToJson());
if (settings.Username.IsNotNullOrWhiteSpace() || settings.Password.IsNotNullOrWhiteSpace())
{
request.AddBasicAuthentication(settings.Username, settings.Password);
}
_httpClient.Execute(request);
}
catch (RestException ex)