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>
This commit is contained in:
Evan Song 2024-11-05 16:21:41 -07:00 committed by GitHub
parent 72cbe7f905
commit 907b1f67ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;