diff --git a/runtime/routes/invoke.ts b/runtime/routes/invoke.ts index 7d948882..d317634c 100644 --- a/runtime/routes/invoke.ts +++ b/runtime/routes/invoke.ts @@ -42,6 +42,10 @@ function getParsingStrategy(req: Request): keyof typeof propsParsers | null { return null; } + if (contentType?.startsWith("multipart/form-data")) { + return "form-data"; + } + if (!contentLength || !contentType) { return "try-json"; } @@ -50,9 +54,6 @@ function getParsingStrategy(req: Request): keyof typeof propsParsers | null { return "json"; } - if (contentType.startsWith("multipart/form-data")) { - return "form-data"; - } return null; }