From 89a1b0f53454874d9453c10e53a1d7cd35dbce30 Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Tue, 16 Nov 2021 13:36:10 -0600 Subject: [PATCH] Fixed: (Cardigann) Do not log config RSSKey or APIKey Fixed: (Cardigann) (v3) Pass APIKey as headers --- .../Indexers/Definitions/Cardigann/CardigannBase.cs | 4 ++-- .../Definitions/Cardigann/CardigannRequestGenerator.cs | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs index 43a1353da..b7a4eb87c 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs @@ -292,7 +292,7 @@ namespace NzbDrone.Core.Indexers.Cardigann var name = ".Config." + setting.Name; var value = Settings.ExtraFieldData.GetValueOrDefault(setting.Name, setting.Default); - if (setting.Type != "password" && indexerLogging) + if ((setting.Type != "password" && setting.Name != "apikey" && setting.Name != "rsskey") && indexerLogging) { _logger.Trace($"{name} got value {value.ToJson()}"); } @@ -334,7 +334,7 @@ namespace NzbDrone.Core.Indexers.Cardigann throw new NotSupportedException(); } - if (setting.Type != "password" && indexerLogging) + if (setting.Type != "password" && setting.Name != "apikey" && setting.Name != "rsskey" && indexerLogging) { _logger.Debug($"Setting {setting.Name} to {variables[name]}"); } diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs index db85ca036..a29f2cc9d 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs @@ -1067,17 +1067,15 @@ namespace NzbDrone.Core.Indexers.Cardigann } } - var request = new CardigannRequest(requestbuilder.Build(), variables, searchPath); - // send HTTP request if (search.Headers != null) { - foreach (var header in search.Headers) - { - request.HttpRequest.Headers.Add(header.Key, header.Value[0]); - } + var headers = ParseCustomHeaders(search.Headers, variables); + requestbuilder.SetHeaders(headers ?? new Dictionary()); } + var request = new CardigannRequest(requestbuilder.Build(), variables, searchPath); + yield return request; } }