This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user