mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
fix: prevent crashing the rest process (#2159)
* fix: prevent crashing the rest process There where instances where some requests crashed the rest process. I found that checking for a body pretty much fixed it. There is probably a better way to do this, please improve this if you have an idea :) * chore: use undefined instead of empty string Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com> * chore: use ternary operator Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>
This commit is contained in:
@@ -42,7 +42,7 @@ async function handleRequest(conn: Deno.Conn) {
|
||||
);
|
||||
}
|
||||
|
||||
const json = (await requestEvent.request.json());
|
||||
const json = requestEvent.request.body ? (await requestEvent.request.json()) : undefined;
|
||||
|
||||
try {
|
||||
const result = await rest.runMethod(
|
||||
|
||||
Reference in New Issue
Block a user