diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-23 10:30:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 09:41:54 +0200 |
commit | 240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e (patch) | |
tree | 99879ddce7d4b2970c263cb045c5057ed07354d4 /server/controllers/api | |
parent | 83e6519ba4ee752dc3148a16c69effbfccb13e6b (diff) | |
download | PeerTube-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.ts | 5 |
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 | ||
40 | function searchVideos (req: express.Request, res: express.Response) { | 40 | function 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) |