admin: use https endpoints for NPM registry

This commit is contained in:
Richard Moore 2021-10-15 22:03:35 -04:00
parent 0a8be37b08
commit b7e61bd67e
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

@ -15,7 +15,7 @@ async function getPackageInfo(name: string): Promise<any> {
if (!cache[name]) { if (!cache[name]) {
try { try {
const result = await getUrl("http:/" + "/registry.npmjs.org/" + name); const result = await getUrl("https:/\/registry.npmjs.org/" + name);
cache[name] = JSON.parse(Buffer.from(result.body).toString("utf8")); cache[name] = JSON.parse(Buffer.from(result.body).toString("utf8"));
} catch (error) { } catch (error) {
if (error.status === 404) { return null; } if (error.status === 404) { return null; }