From 5ee052bd9370ecea9f58d140326e3453f7773a51 Mon Sep 17 00:00:00 2001 From: Daniel H Date: Mon, 27 Mar 2023 22:05:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9e26a11..1ab9527 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,8 @@ server.all('/comment', function get(req, res) { function recurse(post) { console.log(String(cid) + ' ' + comment) if(String(cid) === comment) { - if(req.body.name && req.body.title && req.body.content) { + if(req.body.name && req.body.content) { + if(!req.body.title) req.body.title = ''; let p = {timestamp: new Date().getTime(), author: req.body.name, title: req.body.title, content: req.body.content.replaceAll('\r\n', '\n'), comments: []} post.comments.push(p) if(fake) {