fix(apps): recover stale npm installs

This commit is contained in:
Xubin Ren
2026-05-29 17:26:58 +08:00
parent d7bc1bcfb5
commit 57563b671f
4 changed files with 166 additions and 1 deletions
+2 -1
View File
@@ -40,7 +40,8 @@ async function request<T>(
credentials: "same-origin",
});
if (!res.ok) {
throw new ApiError(res.status, `HTTP ${res.status}`);
const text = typeof res.text === "function" ? (await res.text()).trim() : "";
throw new ApiError(res.status, text || `HTTP ${res.status}`);
}
const contentType = res.headers?.get?.("content-type") ?? "";
if (contentType && !contentType.toLowerCase().includes("application/json")) {