From 907b1f67ed96fb9bcb1d4439e3b613e28383825c Mon Sep 17 00:00:00 2001 From: Evan Song <52982404+ferothefox@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:21:41 -0700 Subject: [PATCH] fix: multipart mrpack by gently holding ofetch's hand and saying "we got this, actually" and we ignore all the bullshit that comes with it (#2921) * fix: multipart mrpack Signed-off-by: Evan Song * fix: use native fetch Signed-off-by: Evan Song --------- Signed-off-by: Evan Song --- apps/frontend/src/composables/pyroServers.ts | 21 ++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/frontend/src/composables/pyroServers.ts b/apps/frontend/src/composables/pyroServers.ts index 26f529116..d4c956536 100644 --- a/apps/frontend/src/composables/pyroServers.ts +++ b/apps/frontend/src/composables/pyroServers.ts @@ -402,12 +402,21 @@ const reinstallFromMrpack = async (mrpack: File, hardReset: boolean = false) => const formData = new FormData(); formData.append("file", mrpack); - return await PyroFetch(`/reinstallMrpackMultiparted?hard=${hardResetParam}`, { - method: "POST", - contentType: "none", - body: formData, - override: auth, - }); + const response = await fetch( + `https://${auth.url}/reinstallMrpackMultiparted?hard=${hardResetParam}`, + { + method: "POST", + headers: { + Authorization: `Bearer ${auth.token}`, + }, + body: formData, + signal: AbortSignal.timeout(30 * 60 * 1000), + }, + ); + + if (!response.ok) { + throw new Error(`[pyroservers] native fetch err status: ${response.status}`); + } } catch (error) { console.error("Error reinstalling from mrpack:", error); throw error;