support http basic auth for registry auth

This commit is contained in:
silverwind 2019-06-29 15:18:14 +02:00
parent 6b489a2a1f
commit ff9c9ca98d
Signed by: silverwind
GPG Key ID: 2E62B41C93869443

@ -238,7 +238,7 @@ function fetchFromRegistry(name, registry, auth) {
name = name.replace(/\//g, "%2f");
}
const opts = (auth && auth.token) ? {headers: {Authorization: `Bearer ${auth.token}`}} : undefined;
const opts = (auth && auth.token) ? {headers: {Authorization: `${auth.type} ${auth.token}`}} : undefined;
return fetch(`${registry}/${name}`, opts);
}