gzip download
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
ale 2024-09-22 06:48:19 +02:00
parent d3c6afa590
commit 3cf8f296cd

View File

@ -504,13 +504,14 @@ module.exports = (app, client) => {
'Content-Type': 'application/x-gzip',
'Content-disposition': 'attachment; filename=fediblock-index.json.gz'
})
(await client.search({
const result = await client.search({
index: constant.index,
size: 9999,
query: {
match_all: {}
}
}, { asStream: true })).pipe(zlib.createGzip()).pipe(res, { end: true })
}, { asStream: true })
result.pipe(zlib.createGzip()).pipe(res, { end: true })
} catch (e) {
console.error(e)
res.status(404).end()