This commit is contained in:
parent
1811e4ed55
commit
e13c5f6744
@ -496,11 +496,11 @@ module.exports = (app, client) => {
|
|||||||
* 200:
|
* 200:
|
||||||
* description: A file compressed with gzip.
|
* description: A file compressed with gzip.
|
||||||
* content:
|
* content:
|
||||||
* application/octect-stream
|
* application/gzip:
|
||||||
*/
|
*/
|
||||||
app.use('/api/download_index', async (req, res) => {
|
app.use('/api/download_index', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
res.setHeader('Content-Type', 'application/x-gzip')
|
res.setHeader('Content-Type', 'application/gzip')
|
||||||
res.setHeader('Content-disposition', 'attachment; filename=fediblock-index.json.gz')
|
res.setHeader('Content-disposition', 'attachment; filename=fediblock-index.json.gz')
|
||||||
const result = await client.search({
|
const result = await client.search({
|
||||||
index: constant.index,
|
index: constant.index,
|
||||||
|
@ -117,7 +117,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
a = document.createElement('a')
|
a = document.createElement('a')
|
||||||
a.download = 'fediblock-index.json.gz'
|
a.download = 'fediblock-index.json.gz'
|
||||||
a.href = URL.createObjectURL(res)
|
a.href = URL.createObjectURL(res)
|
||||||
a.type = 'application/x-gzip'
|
a.type = 'application/gzip'
|
||||||
a.target = '_blank'
|
a.target = '_blank'
|
||||||
a.dispatchEvent(new MouseEvent('click'))
|
a.dispatchEvent(new MouseEvent('click'))
|
||||||
document.getElementById('loader-content').style.display = 'none'
|
document.getElementById('loader-content').style.display = 'none'
|
||||||
|
Loading…
Reference in New Issue
Block a user