リモートサーバーのファイルをデータベースに保存せず、クライアントで直接表示させられるように

This commit is contained in:
syuilo 2018-05-25 20:19:14 +09:00
parent e804757d83
commit 558b897700
10 changed files with 110 additions and 60 deletions

View file

@ -33,11 +33,12 @@ export default async function(ctx: Koa.Context) {
if (file.metadata.deletedAt) {
ctx.status = 410;
if (file.metadata.isExpired) {
await send(ctx, '/cache-expired.png', { root: assets });
} else {
await send(ctx, '/tombstone.png', { root: assets });
}
await send(ctx, '/tombstone.png', { root: assets });
return;
}
if (file.metadata.isMetaOnly) {
ctx.status = 204;
return;
}