diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-17 12:42:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-06-17 12:42:16 +0200 |
commit | 67c604ae691e372c35dff90e7343c9232dc87511 (patch) | |
tree | 3c41a2f749c2e66381815e52db67670f08b8850c /server | |
parent | f11bc5660277f1f070b1797c10282585bd962ac5 (diff) | |
download | PeerTube-67c604ae691e372c35dff90e7343c9232dc87511.tar.gz PeerTube-67c604ae691e372c35dff90e7343c9232dc87511.tar.zst PeerTube-67c604ae691e372c35dff90e7343c9232dc87511.zip |
Fix server build
Diffstat (limited to 'server')
-rw-r--r-- | server/middlewares/validators/oembed.ts | 7 |
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.' }) |