This commit is contained in:
parent
6ce68b15c5
commit
ec97d51ab0
@ -499,7 +499,7 @@ module.exports = (app, client) => {
|
|||||||
* application/octect-stream
|
* application/octect-stream
|
||||||
*/
|
*/
|
||||||
app.use('/api/download_index', async (req, res) => {
|
app.use('/api/download_index', async (req, res) => {
|
||||||
if (req.params.instance && req.params.instance.length > 0) {
|
try {
|
||||||
const result = await client.search({
|
const result = await client.search({
|
||||||
index: constant.index,
|
index: constant.index,
|
||||||
size: 9999,
|
size: 9999,
|
||||||
@ -512,7 +512,8 @@ module.exports = (app, client) => {
|
|||||||
'Content-disposition': 'attachment; filename=fediblock-index.json.gz'
|
'Content-disposition': 'attachment; filename=fediblock-index.json.gz'
|
||||||
})
|
})
|
||||||
result.pipe(zlib.createGzip()).pipe(res, { end: true })
|
result.pipe(zlib.createGzip()).pipe(res, { end: true })
|
||||||
} else {
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
res.status(404).end()
|
res.status(404).end()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user