diff --git a/lib/apiswagger.js b/lib/apiswagger.js index 373d4ed..d8f7c7e 100644 --- a/lib/apiswagger.js +++ b/lib/apiswagger.js @@ -502,13 +502,14 @@ module.exports = (app, client) => { try { res.header('Content-Type', 'application/x-gzip') res.header('Content-disposition', 'attachment; filename=fediblock-index.json.gz') - (await client.search({ - index: constant.index, - size: 9999, - query: { - match_all: {} - } - }, { asStream: true })).pipe(zlib.createGzip()).pipe(res, { end: true }) + const result = await client.search({ + index: constant.index, + size: 9999, + query: { + match_all: {} + } + }, { asStream: true }) + result.pipe(zlib.createGzip()).pipe(res, { end: true }) } catch (e) { console.error(e) res.status(404).end()