Fixed: (Cardigann) Do not log config RSSKey or APIKey

Fixed: (Cardigann) (v3) Pass APIKey as headers
pull/614/head
bakerboy448 3 years ago committed by Qstick
parent 1aa9149866
commit 89a1b0f534

@ -292,7 +292,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
var name = ".Config." + setting.Name; var name = ".Config." + setting.Name;
var value = Settings.ExtraFieldData.GetValueOrDefault(setting.Name, setting.Default); 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()}"); _logger.Trace($"{name} got value {value.ToJson()}");
} }
@ -334,7 +334,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
throw new NotSupportedException(); 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]}"); _logger.Debug($"Setting {setting.Name} to {variables[name]}");
} }

@ -1067,17 +1067,15 @@ namespace NzbDrone.Core.Indexers.Cardigann
} }
} }
var request = new CardigannRequest(requestbuilder.Build(), variables, searchPath);
// send HTTP request // send HTTP request
if (search.Headers != null) if (search.Headers != null)
{ {
foreach (var header in search.Headers) var headers = ParseCustomHeaders(search.Headers, variables);
{ requestbuilder.SetHeaders(headers ?? new Dictionary<string, string>());
request.HttpRequest.Headers.Add(header.Key, header.Value[0]);
}
} }
var request = new CardigannRequest(requestbuilder.Build(), variables, searchPath);
yield return request; yield return request;
} }
} }

Loading…
Cancel
Save