You've already forked AstralRinth
forked from didirus/AstralRinth
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:
@@ -402,12 +402,21 @@ const reinstallFromMrpack = async (mrpack: File, hardReset: boolean = false) =>
|
|||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file", mrpack);
|
formData.append("file", mrpack);
|
||||||
|
|
||||||
return await PyroFetch(`/reinstallMrpackMultiparted?hard=${hardResetParam}`, {
|
const response = await fetch(
|
||||||
method: "POST",
|
`https://${auth.url}/reinstallMrpackMultiparted?hard=${hardResetParam}`,
|
||||||
contentType: "none",
|
{
|
||||||
body: formData,
|
method: "POST",
|
||||||
override: auth,
|
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) {
|
} catch (error) {
|
||||||
console.error("Error reinstalling from mrpack:", error);
|
console.error("Error reinstalling from mrpack:", error);
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user