Export: убран filename из Content-Disposition для диалога сохранения
Версия: 0.1.13 Документация: db-query-endpoint.md
This commit is contained in:
@@ -45,11 +45,10 @@ function createExportRouter() {
|
||||
return res.send(text);
|
||||
}
|
||||
|
||||
// Скачивание (по умолчанию)
|
||||
// Скачивание (по умолчанию) — без filename чтобы браузер показал диалог сохранения
|
||||
const text = aggregated.join('\n') + (aggregated.length ? '\n' : '');
|
||||
res.set('Content-Type', 'text/plain; charset=utf-8');
|
||||
const fname = (req.query.filename || 'white-list.txt').replace(/[^\w\-_. ]/g, '_');
|
||||
res.set('Content-Disposition', 'attachment; filename="' + fname + '"');
|
||||
res.set('Content-Disposition', 'attachment');
|
||||
res.send(text);
|
||||
} catch (e) {
|
||||
console.error('[v2:export] Error:', e);
|
||||
|
||||
Reference in New Issue
Block a user