Skip to content

Commit

Permalink
fix: multipart mrpack by gently holding ofetch's hand and saying "we …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
ferothefox authored Nov 5, 2024
1 parent 72cbe7f commit 907b1f6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions apps/frontend/src/composables/pyroServers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 907b1f6

Please sign in to comment.