Working toward an openly accessable registry
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm
2020-08-02 22:33:18 +02:00
parent 855034f14d
commit 4aaee3e419
8 changed files with 64 additions and 18 deletions

View File

@ -110,7 +110,7 @@ async function uploadPackage(ctx: ABC.Context) {
if (!packageMeta) {
packageMeta = {
name: packageName,
author: meta.author,
author: ctx.customContext.user,
description: meta.description,
deprecated: false,
versions: [],
@ -157,7 +157,7 @@ async function uploadPackage(ctx: ABC.Context) {
{
$set: {
versions: [...packageMeta.versions, packageVersion],
author: meta.author || packageMeta.author,
author: ctx.customContext.user,
description: meta.description || packageMeta.description,
deprecated: meta.deprecated === true,
},

View File

@ -57,7 +57,7 @@ export default function views(g: ABC.Application) {
.update(`${packageName}:${packageVersion}`)
.toString("base64");
await ctx.render("package", { pkg });
await ctx.render("package", { pkg, version: packageVersion });
ctx.response.headers.set("cache-control", CACHE_CONTROL);
ctx.response.headers.set("E-Tag", etag);
});