Skip to content
Snippets Groups Projects
Commit c5a015df authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor: Authorization -> authorization

parent 2bacbe11
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ async function getAuthHeaders(registry, repository) { ...@@ -55,7 +55,7 @@ async function getAuthHeaders(registry, repository) {
const auth = Buffer.from(`${opts.username}:${opts.password}`).toString( const auth = Buffer.from(`${opts.username}:${opts.password}`).toString(
'base64' 'base64'
); );
opts.headers = { Authorization: `Basic ${auth}` }; opts.headers = { authorization: `Basic ${auth}` };
} }
if (authenticateHeader.scheme.toUpperCase() === 'BASIC') { if (authenticateHeader.scheme.toUpperCase() === 'BASIC') {
...@@ -76,7 +76,7 @@ async function getAuthHeaders(registry, repository) { ...@@ -76,7 +76,7 @@ async function getAuthHeaders(registry, repository) {
return null; return null;
} }
return { return {
Authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
}; };
} catch (err) /* istanbul ignore next */ { } catch (err) /* istanbul ignore next */ {
if (err.statusCode === 401) { if (err.statusCode === 401) {
......
...@@ -73,7 +73,7 @@ async function getPackagistFile(regUrl, file) { ...@@ -73,7 +73,7 @@ async function getPackagistFile(regUrl, file) {
const { key, sha256 } = file; const { key, sha256 } = file;
const fileName = key.replace('%hash%', sha256); const fileName = key.replace('%hash%', sha256);
const opts = getHostOpts(regUrl); const opts = getHostOpts(regUrl);
if (opts.auth || (opts.headers && opts.headers.Authorization)) { if (opts.auth || (opts.headers && opts.headers.authorization)) {
return (await got(regUrl + '/' + fileName, opts)).body; return (await got(regUrl + '/' + fileName, opts)).body;
} }
const cacheNamespace = 'datasource-packagist-files'; const cacheNamespace = 'datasource-packagist-files';
......
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