asd
All checks were successful
Deploy / deploy-production (push) Has been skipped
Deploy / deploy-staging (push) Successful in 6s

This commit is contained in:
2026-04-11 02:45:46 +02:00
parent bbd2e39f86
commit 8786c079a8

View File

@@ -205,7 +205,12 @@
let response;
try {
response = await fetch(requestUrl, { ...requestOptions, signal: controller.signal });
response = await fetch(requestUrl, {
...requestOptions,
credentials: 'same-origin',
redirect: 'manual',
signal: controller.signal,
});
} catch (error) {
window.clearTimeout(timeoutId);
if (error && error.name === 'AbortError') {
@@ -224,12 +229,26 @@
type: 'request:error',
method: requestOptions.method || 'GET',
url: requestUrl,
page_url: window.location.href,
online: window.navigator ? window.navigator.onLine : null,
message: error && error.message ? error.message : 'Fetch fehlgeschlagen',
});
throw error;
}
window.clearTimeout(timeoutId);
if (response.type === 'opaqueredirect' || (response.status >= 300 && response.status < 400)) {
const location = response.headers ? response.headers.get('Location') : '';
emitDebug({
type: 'request:redirect',
method: requestOptions.method || 'GET',
url: requestUrl,
status: response.status,
location: location || null,
});
throw new Error(`API request wurde weitergeleitet${location ? ` nach ${location}` : ''}. Bitte Login/Session und Proxy-Rewrite pruefen.`);
}
const payload = await response.json().catch(() => ({}));
emitDebug({
type: 'request:response',