[0.2.7.7][ci]
All checks were successful
CI / docker-ci (push) Successful in 35s

This commit is contained in:
DSQ
2026-03-23 10:37:46 +08:00
parent fe7f08ed1c
commit c9611fa622
2 changed files with 95 additions and 86 deletions

View File

@@ -445,6 +445,11 @@ async function generateReport() {
try {
const params = buildReportParams();
const resp = await fetch(`/elastic/report/?${params.toString()}`, { credentials: 'same-origin' });
const ct = (resp.headers.get('content-type') || '').toLowerCase();
if (!ct.includes('application/json')) {
const text = await resp.text();
throw new Error(text ? String(text).slice(0, 200) : `HTTP ${resp.status}`);
}
const data = await resp.json();
if (data.status !== 'success') {
reportBox.className = 'search-result error';