From a15175757fc8c4003996b7a7ed2fae43607be3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saymon=20Dam=C3=A1sio?= Date: Tue, 5 Nov 2024 11:05:21 -0300 Subject: [PATCH] fix: move form-data validation (#867) --- runtime/routes/invoke.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/routes/invoke.ts b/runtime/routes/invoke.ts index 7d948882f..d317634c4 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; }