Potential fix for code scanning alert no. 139: Uncontrolled data used in path expression

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
ي
2026-05-25 17:25:28 +05:30
committed by GitHub
parent cb3666dd7b
commit 8000d21a05

View File

@@ -142,11 +142,11 @@ async def serve_transform_video(
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")
return FileResponse(
path=str(video_path),
path=str(resolved_video_path),
media_type="video/mp4",
filename=video_filename
)