1
0
Fork 0

Fix server build

This commit is contained in:
Chocobozzz 2020-06-17 12:42:16 +02:00
parent f11bc56602
commit 67c604ae69
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -37,8 +37,11 @@ const oembedValidator = [
.end() .end()
} }
const startIsOk = req.query.url.startsWith(urlShouldStartWith) const url = req.query.url as string
const matches = videoWatchRegex.exec(req.query.url)
const startIsOk = url.startsWith(urlShouldStartWith)
const matches = videoWatchRegex.exec(url)
if (startIsOk === false || matches === null) { if (startIsOk === false || matches === null) {
return res.status(400) return res.status(400)
.json({ error: 'Invalid url.' }) .json({ error: 'Invalid url.' })