aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/oembed.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-17 12:42:16 +0200
committerChocobozzz <me@florianbigard.com>2020-06-17 12:42:16 +0200
commit67c604ae691e372c35dff90e7343c9232dc87511 (patch)
tree3c41a2f749c2e66381815e52db67670f08b8850c /server/middlewares/validators/oembed.ts
parentf11bc5660277f1f070b1797c10282585bd962ac5 (diff)
downloadPeerTube-67c604ae691e372c35dff90e7343c9232dc87511.tar.gz
PeerTube-67c604ae691e372c35dff90e7343c9232dc87511.tar.zst
PeerTube-67c604ae691e372c35dff90e7343c9232dc87511.zip
Fix server build
Diffstat (limited to 'server/middlewares/validators/oembed.ts')
-rw-r--r--server/middlewares/validators/oembed.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/middlewares/validators/oembed.ts b/server/middlewares/validators/oembed.ts
index 24ba5569d..ab4dbb4d1 100644
--- a/server/middlewares/validators/oembed.ts
+++ b/server/middlewares/validators/oembed.ts
@@ -37,8 +37,11 @@ const oembedValidator = [
37 .end() 37 .end()
38 } 38 }
39 39
40 const startIsOk = req.query.url.startsWith(urlShouldStartWith) 40 const url = req.query.url as string
41 const matches = videoWatchRegex.exec(req.query.url) 41
42 const startIsOk = url.startsWith(urlShouldStartWith)
43 const matches = videoWatchRegex.exec(url)
44
42 if (startIsOk === false || matches === null) { 45 if (startIsOk === false || matches === null) {
43 return res.status(400) 46 return res.status(400)
44 .json({ error: 'Invalid url.' }) 47 .json({ error: 'Invalid url.' })