projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f11bc56
)
Fix server build
author
Chocobozzz
<me@florianbigard.com>
Wed, 17 Jun 2020 10:42:16 +0000
(12:42 +0200)
committer
Chocobozzz
<me@florianbigard.com>
Wed, 17 Jun 2020 10:42:16 +0000
(12:42 +0200)
server/middlewares/validators/oembed.ts
patch
|
blob
|
history
diff --git
a/server/middlewares/validators/oembed.ts
b/server/middlewares/validators/oembed.ts
index 24ba5569dc9f1fd9f62a815bea870afe19ea0f3c..ab4dbb4d1814438b33b7821b9bcb11993ed02b0f 100644
(file)
--- a/
server/middlewares/validators/oembed.ts
+++ b/
server/middlewares/validators/oembed.ts
@@
-37,8
+37,11
@@
const oembedValidator = [
.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.' })