From 90d329cfd8807d4a5a4b8a07ce453eeec432b1bd Mon Sep 17 00:00:00 2001 From: monoid Date: Fri, 15 Jan 2021 20:20:23 +0900 Subject: [PATCH] don't render deleted content --- src/route/contents.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/route/contents.ts b/src/route/contents.ts index 9609f22..7561f4a 100644 --- a/src/route/contents.ts +++ b/src/route/contents.ts @@ -122,6 +122,9 @@ const ContentHandler = (controller : DocumentAccessor) => async (ctx:Context, ne if (document == undefined){ return sendError(404,"document does not exist."); } + if(document.deleted_at !== null){ + return sendError(404,"document has been removed."); + } const path = join(document.basepath,document.filename); ctx.state['location'] = { path:path,