Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/src/app/api/video/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export async function POST(request: Request) {
// Works on Vercel without the Python backend by chaining the serverless
// /api/transcribe and /api/extract-events routes directly.

// Use trusted backend origin instead of deriving from potentially user-controlled request data
const origin = BACKEND_URL;

Comment on lines +107 to +109
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

origin is declared but never used, and the surrounding comment suggests the code is avoiding deriving an origin from the incoming request. As written, the route still derives baseUrl from request.url for the internal /api/transcribe and /api/extract-events calls, so this is dead code and potentially misleading. Either remove origin/the comment, or actually use a trusted, configured app origin when building those internal URLs (and rename the variable accordingly).

Suggested change
// Use trusted backend origin instead of deriving from potentially user-controlled request data
const origin = BACKEND_URL;

Copilot uses AI. Check for mistakes.
// Step 1: Get transcript
let transcript = '';
let transcriptSource = 'none';
try {
Expand Down
Loading