Skip to content
Snippets Groups Projects
Unverified Commit 30f461f7 authored by Michael Kriese's avatar Michael Kriese Committed by GitHub
Browse files

fix: improve logging (#7587)

parent 73a1722c
No related branches found
No related tags found
No related merge requests found
...@@ -14,13 +14,13 @@ export function applyHostRules(url: string, inOptions: GotOptions): GotOptions { ...@@ -14,13 +14,13 @@ export function applyHostRules(url: string, inOptions: GotOptions): GotOptions {
}) || /* istanbul ignore next: can only happen in tests */ {}; }) || /* istanbul ignore next: can only happen in tests */ {};
const { username, password, token, enabled } = foundRules; const { username, password, token, enabled } = foundRules;
if (options.headers?.authorization || options.password || options.token) { if (options.headers?.authorization || options.password || options.token) {
logger.trace(`Authorization already set for host: ${url}`); logger.trace({ url }, `Authorization already set`);
} else if (password) { } else if (password) {
logger.trace(`Applying Basic authentication for host ${url}`); logger.trace({ url }, `Applying Basic authentication`);
options.username = username; options.username = username;
options.password = password; options.password = password;
} else if (token) { } else if (token) {
logger.trace(`Applying Bearer authentication for host ${url}`); logger.trace({ url }, `Applying Bearer authentication`);
options.token = token; options.token = token;
} else if (enabled === false) { } else if (enabled === false) {
options.enabled = false; options.enabled = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment