Export: убран filename из Content-Disposition для диалога сохранения

Версия: 0.1.13
Документация: db-query-endpoint.md
This commit is contained in:
2026-07-08 14:57:17 +04:00
parent d20bd85a7d
commit 4bdcb4c363
5 changed files with 81 additions and 5 deletions
+2 -3
View File
@@ -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);