diff --git a/lib/logger/utils.ts b/lib/logger/utils.ts index 955f088d3f0c21d0fbb603f050f2736a2ccd9bd6..d9cb166a507471ddd97ee95aaddbe9ec6635ae96 100644 --- a/lib/logger/utils.ts +++ b/lib/logger/utils.ts @@ -127,7 +127,9 @@ export function sanitizeValue(value: unknown, seen = new WeakMap()): any { seen.set(value as any, objectResult); for (const [key, val] of Object.entries<any>(value)) { let curValue: any; - if (redactedFields.includes(key)) { + if (!val) { + curValue = val; + } else if (redactedFields.includes(key)) { curValue = '***********'; } else if (contentFields.includes(key)) { curValue = '[content]'; diff --git a/lib/util/http/host-rules.ts b/lib/util/http/host-rules.ts index 1146fe5a676c6bb2be5107472f5ffd9c215297a8..5c5ee572e3849339fa002f4e06778220330df28b 100644 --- a/lib/util/http/host-rules.ts +++ b/lib/util/http/host-rules.ts @@ -14,13 +14,13 @@ export function applyHostRules(url: string, inOptions: GotOptions): GotOptions { }) || /* istanbul ignore next: can only happen in tests */ {}; const { username, password, token, enabled } = foundRules; if (options.headers?.authorization || options.password || options.token) { - logger.trace(`Authorization already set for host: ${options.hostname}`); + logger.trace(`Authorization already set for host: ${url}`); } else if (password) { - logger.trace(`Applying Basic authentication for host ${options.hostname}`); + logger.trace(`Applying Basic authentication for host ${url}`); options.username = username; options.password = password; } else if (token) { - logger.trace(`Applying Bearer authentication for host ${options.hostname}`); + logger.trace(`Applying Bearer authentication for host ${url}`); options.token = token; } else if (enabled === false) { options.enabled = false;