Skip to content

Commit

Permalink
basic auth with base64 username:password should be labelled Basic, no…
Browse files Browse the repository at this point in the history
…t Bearer
  • Loading branch information
plumpNation authored Apr 11, 2024
1 parent 4672162 commit 780acec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/httpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function fetch(input: string | URL, init?: RequestInit) {
if (username || password) {
headers = {
...headers,
authorization: `Bearer ${Buffer.from(`${username}:${password}`).toString(`base64`)}`,
authorization: `Basic ${Buffer.from(`${username}:${password}`).toString(`base64`)}`,
};
input.username = input.password = ``;
} else if (input.origin === process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL) {
Expand All @@ -32,7 +32,7 @@ async function fetch(input: string | URL, init?: RequestInit) {
} else if (`COREPACK_NPM_PASSWORD` in process.env) {
headers = {
...headers,
authorization: `Bearer ${Buffer.from(`${process.env.COREPACK_NPM_USER}:${process.env.COREPACK_NPM_PASSWORD}`).toString(`base64`)}`,
authorization: `Basic ${Buffer.from(`${process.env.COREPACK_NPM_USER}:${process.env.COREPACK_NPM_PASSWORD}`).toString(`base64`)}`,
};
}
}
Expand Down

0 comments on commit 780acec

Please sign in to comment.