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:
@@ -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
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user