aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/blocklist.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/middlewares/validators/blocklist.ts b/server/middlewares/validators/blocklist.ts
index 47a0b1a1c..b2183437c 100644
--- a/server/middlewares/validators/blocklist.ts
+++ b/server/middlewares/validators/blocklist.ts
@@ -84,11 +84,9 @@ const blockServerValidator = [
84 .end() 84 .end()
85 } 85 }
86 86
87 const server = await ServerModel.loadByHost(host) 87 let server = await ServerModel.loadByHost(host)
88 if (!server) { 88 if (!server) {
89 return res.status(404) 89 server = await ServerModel.create({ host })
90 .send({ error: 'Server host not found.' })
91 .end()
92 } 90 }
93 91
94 res.locals.server = server 92 res.locals.server = server