fix(stt): bound audio download response size#5412
Conversation
Cap the audioUrl download in the STT proxy route at the platform's standard 100MB file-size ceiling, matching the pattern already used by sharepoint/download-file and other external download routes. Classify size-limit rejections as a clean 413 instead of an unhandled 500.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview When that limit is hit, the route returns 413 with “Audio file exceeds the maximum supported size” instead of a generic 500, using New Reviewed by Cursor Bugbot for commit 5602707. Configure here. |
|
@greptile-apps review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5602707. Configure here.
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5602707. Configure here.
Summary
audioUrldownload path had no response size cap, unlike the sibling download routes (e.g.sharepoint/download-file) which already passmaxResponseBytes.MAX_FILE_SIZEfrom@/lib/uploads/utils/validation) into thesecureFetchWithPinnedIPcall foraudioUrl.video/route.tsandtts/route.ts.Type of Change
Testing
apps/sim/app/api/tools/stt/route.test.tscovering: an oversizedaudioUrldownload is rejected with a 413 and clear message, and a normal well-under-cap download still transcribes successfully.bun run vitest run app/api/tools/stt/route.test.tspasses.bunx tsc --noEmit,bunx biome check, andbun run check:api-validationall pass on the changed files.Checklist