diff --git a/lib/apiswagger.js b/lib/apiswagger.js index be4ca3f..e7bc2a7 100644 --- a/lib/apiswagger.js +++ b/lib/apiswagger.js @@ -504,13 +504,14 @@ module.exports = (app, client) => { 'Content-Type': 'application/x-gzip', '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()