Улучшить вложения и запись голосовых в личной переписке

This commit is contained in:
AidarKC
2026-11-17 15:34:36 +03:00
parent 1f06629838
commit 2dd0ed6d59
9 changed files with 251 additions and 40 deletions
@@ -39,6 +39,10 @@ async function lookup(login, base) {
method: 'GET', cache: 'no-store', credentials: 'omit', referrerPolicy: 'no-referrer',
});
if (!response.ok) throw new Error(`Access-server lookup HTTP ${response.status}`);
const contentType = String(response.headers?.get?.('Content-Type') || '').toLowerCase();
if (contentType && !contentType.includes('application/json')) {
throw new Error('Access-server file directory returned a non-JSON response');
}
return normalizeServerResponse(await response.json());
}