Merge branch 'main' into feat/multi-host

This commit is contained in:
2025-10-07 18:04:24 +02:00
13 changed files with 237 additions and 40 deletions

View File

@@ -49,11 +49,8 @@ async function apiCall<T>(
} else {
// Handle empty responses for JSON endpoints
const contentLength = response.headers.get('content-length');
if (contentLength === '0' || contentLength === null) {
const text = await response.text();
if (text.trim() === '') {
return {} as T; // Return empty object for empty JSON responses
}
if (contentLength === '0') {
return {} as T; // Return empty object for empty JSON responses
}
const data = await response.json() as T;
return data;