This commit is contained in:
parent
8356295433
commit
bc52c4b8cc
@ -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({
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user