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:
parent
72cbe7f905
commit
907b1f67ed
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user