We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be3d8e7 commit 943f3e5Copy full SHA for 943f3e5
routes/redirect.js
@@ -10,6 +10,12 @@ module.exports = Router()
10
res.redirect(301, process.env.HOMEPAGE)
11
})
12
.get(`/:hash(${schema.Link.properties.hash.pattern})`, async (req, res) => {
13
+ if (
14
+ req.params.hash.length < schema.Link.properties.hash.minLength ||
15
+ req.params.hash.length > schema.Link.properties.hash.maxLength
16
+ )
17
+ return res.sendStatus(404)
18
+
19
const link = await Link.query()
20
.findByHashId(req.params.hash)
21
.throwIfNotFound()
0 commit comments