mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix(auth): fix HTTP Basic auth for NOPASS indexes (#8442)
This commit is contained in:
parent
4eaa81ac56
commit
9e09363305
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ export function applyAuthorization(inOptions: GotOptions): GotOptions {
|
||||||
options.headers.authorization = `Bearer ${options.token}`;
|
options.headers.authorization = `Bearer ${options.token}`;
|
||||||
}
|
}
|
||||||
delete options.token;
|
delete options.token;
|
||||||
} else if (options.password) {
|
} else if (options.password !== undefined) {
|
||||||
// Otherwise got will add username and password to url and header
|
// Otherwise got will add username and password to url and header
|
||||||
const auth = Buffer.from(
|
const auth = Buffer.from(
|
||||||
`${options.username || ''}:${options.password}`
|
`${options.username || ''}:${options.password}`
|
||||||
|
|
|
@ -15,7 +15,7 @@ export function applyHostRules(url: string, inOptions: GotOptions): GotOptions {
|
||||||
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({ url }, `Authorization already set`);
|
logger.trace({ url }, `Authorization already set`);
|
||||||
} else if (password) {
|
} else if (password !== undefined) {
|
||||||
logger.trace({ url }, `Applying Basic authentication`);
|
logger.trace({ url }, `Applying Basic authentication`);
|
||||||
options.username = username;
|
options.username = username;
|
||||||
options.password = password;
|
options.password = password;
|
||||||
|
|
Loading…
Reference in a new issue