Skip to content

Commit 907b1f6

Browse files
authored
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 <theevansong@gmail.com> * fix: use native fetch Signed-off-by: Evan Song <theevansong@gmail.com> --------- Signed-off-by: Evan Song <theevansong@gmail.com>
1 parent 72cbe7f commit 907b1f6

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

apps/frontend/src/composables/pyroServers.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,21 @@ const reinstallFromMrpack = async (mrpack: File, hardReset: boolean = false) =>
402402
const formData = new FormData();
403403
formData.append("file", mrpack);
404404

405-
return await PyroFetch(`/reinstallMrpackMultiparted?hard=${hardResetParam}`, {
406-
method: "POST",
407-
contentType: "none",
408-
body: formData,
409-
override: auth,
410-
});
405+
const response = await fetch(
406+
`https://${auth.url}/reinstallMrpackMultiparted?hard=${hardResetParam}`,
407+
{
408+
method: "POST",
409+
headers: {
410+
Authorization: `Bearer ${auth.token}`,
411+
},
412+
body: formData,
413+
signal: AbortSignal.timeout(30 * 60 * 1000),
414+
},
415+
);
416+
417+
if (!response.ok) {
418+
throw new Error(`[pyroservers] native fetch err status: ${response.status}`);
419+
}
411420
} catch (error) {
412421
console.error("Error reinstalling from mrpack:", error);
413422
throw error;

0 commit comments

Comments
 (0)