aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-23 10:30:53 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e (patch)
tree99879ddce7d4b2970c263cb045c5057ed07354d4 /server/controllers/api
parent83e6519ba4ee752dc3148a16c69effbfccb13e6b (diff)
downloadPeerTube-240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e.tar.gz
PeerTube-240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e.tar.zst
PeerTube-240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e.zip
Fix tests
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/search.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts
index d95e7cac9..f408e7932 100644
--- a/server/controllers/api/search.ts
+++ b/server/controllers/api/search.ts
@@ -39,8 +39,9 @@ export { searchRouter }
39 39
40function searchVideos (req: express.Request, res: express.Response) { 40function searchVideos (req: express.Request, res: express.Response) {
41 const query: VideosSearchQuery = req.query 41 const query: VideosSearchQuery = req.query
42 if (query.search.startsWith('http://') || query.search.startsWith('https://')) { 42 const search = query.search
43 return searchVideoUrl(query.search, res) 43 if (search && (search.startsWith('http://') || search.startsWith('https://'))) {
44 return searchVideoUrl(search, res)
44 } 45 }
45 46
46 return searchVideosDB(query, res) 47 return searchVideosDB(query, res)