fix: прод — CORS, версия API, ошибки клиента и подсказка по прошедшим стартам
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
- CORS_ORIGIN: несколько origin через запятую; комментарии в .env.example - Версия бэкенда: APP_VERSION, безопасное чтение package.json, футер при пустой версии - Сообщения API: unknown_error и ответы 401/403/404 без JSON; отладочный лог при !ok - Статус «внесите результат» для прошедшей даты + блок на карточке старта и стили
This commit is contained in:
@@ -55,6 +55,25 @@ export async function requestJson<T>(path: string, init?: RequestInit): Promise<
|
||||
await delay(80 * attempt);
|
||||
continue;
|
||||
}
|
||||
// #region agent log
|
||||
fetch("http://127.0.0.1:7488/ingest/a18f912f-72c6-4a58-866b-17810a6b89d2", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", "X-Debug-Session-Id": "587ee5" },
|
||||
body: JSON.stringify({
|
||||
sessionId: "587ee5",
|
||||
hypothesisId: "H-http-not-ok",
|
||||
location: "http.ts:requestJson",
|
||||
message: "HTTP error response",
|
||||
data: {
|
||||
path,
|
||||
status: response.status,
|
||||
contentType: response.headers.get("content-type"),
|
||||
payloadIsObject: payload !== null && typeof payload === "object",
|
||||
},
|
||||
timestamp: Date.now(),
|
||||
}),
|
||||
}).catch(() => {});
|
||||
// #endregion
|
||||
throw toApiError(response.status, payload);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user