import * as express from 'express'
-import { query } from 'express-validator/check'
+import { query } from 'express-validator'
import { join } from 'path'
import { isTestInstance } from '../../helpers/core-utils'
import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
.end()
}
- const startIsOk = req.query.url.startsWith(urlShouldStartWith)
- const matches = videoWatchRegex.exec(req.query.url)
+ const url = req.query.url as string
+
+ const startIsOk = url.startsWith(urlShouldStartWith)
+ const matches = videoWatchRegex.exec(url)
+
if (startIsOk === false || matches === null) {
return res.status(400)
.json({ error: 'Invalid url.' })