aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/plugins')
-rw-r--r--server/lib/plugins/plugin-index.ts15
1 files changed, 10 insertions, 5 deletions
diff --git a/server/lib/plugins/plugin-index.ts b/server/lib/plugins/plugin-index.ts
index 4a8a90ec8..63cd47e63 100644
--- a/server/lib/plugins/plugin-index.ts
+++ b/server/lib/plugins/plugin-index.ts
@@ -27,13 +27,18 @@ async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList)
27 27
28 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins' 28 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins'
29 29
30 const { body } = await doRequest({ uri, qs, json: true }) 30 try {
31 const { body } = await doRequest({ uri, qs, json: true })
31 32
32 logger.debug('Got result from PeerTube index.', { body }) 33 logger.debug('Got result from PeerTube index.', { body })
33 34
34 await addInstanceInformation(body) 35 await addInstanceInformation(body)
35 36
36 return body as ResultList<PeerTubePluginIndex> 37 return body as ResultList<PeerTubePluginIndex>
38 } catch (err) {
39 logger.error('Cannot list available plugins from index %s.', uri, { err })
40 return undefined
41 }
37} 42}
38 43
39async function addInstanceInformation (result: ResultList<PeerTubePluginIndex>) { 44async function addInstanceInformation (result: ResultList<PeerTubePluginIndex>) {
@@ -53,7 +58,7 @@ async function getLatestPluginsVersion (npmNames: string[]): Promise<PeertubePlu
53 58
54 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins/latest-version' 59 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins/latest-version'
55 60
56 const { body } = await doRequest({ uri, body: bodyRequest }) 61 const { body } = await doRequest({ uri, body: bodyRequest, json: true, method: 'POST' })
57 62
58 return body 63 return body
59} 64}