fix: use canonicalized resolved_video_path in transform serving (#527)

This commit is contained in:
ajaysi
2026-05-25 20:31:07 +05:30

View File

@@ -142,11 +142,11 @@ async def serve_transform_video(
detail="Invalid video path: path traversal detected" detail="Invalid video path: path traversal detected"
) )
if not video_path.exists(): if not resolved_video_path.exists():
raise HTTPException(status_code=404, detail="Video not found") raise HTTPException(status_code=404, detail="Video not found")
return FileResponse( return FileResponse(
path=str(video_path), path=str(resolved_video_path),
media_type="video/mp4", media_type="video/mp4",
filename=video_filename filename=video_filename
) )