Skip to content

Commit

Permalink
fix: move form-data validation (#867)
Browse files Browse the repository at this point in the history
  • Loading branch information
saymondamasio authored Nov 5, 2024
1 parent 53295b7 commit a151757
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runtime/routes/invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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;
}
Expand Down

0 comments on commit a151757

Please sign in to comment.