mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 09:50:07 +00:00
Update request_manager.ts
This commit is contained in:
@@ -222,16 +222,17 @@ function runMethod(
|
||||
!url.startsWith(IMAGE_BASE_URL)
|
||||
) {
|
||||
return fetch(url, {
|
||||
body: JSON.stringify({
|
||||
url,
|
||||
method,
|
||||
body: body || {},
|
||||
}),
|
||||
body: JSON.stringify(body || {}),
|
||||
headers: {
|
||||
authorization: restAuthorization,
|
||||
},
|
||||
method: method.toUpperCase(),
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
if (res.status === 204) return undefined;
|
||||
|
||||
return res.json();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
throw errorStack;
|
||||
|
||||
Reference in New Issue
Block a user