Skip to content

Commit 7d47ab6

Browse files
Mihir7027claude
andcommitted
fix(api): quote filename in Content-Disposition download header
The filename token was unquoted, producing a malformed header for any video whose stem contains spaces or special characters. Per RFC 6266, the filename parameter must be a quoted-string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6cd36b5 commit 7d47ab6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/controllers/v1/video.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ async def download_video(request: Request, file_path: str):
495495
file_path = pathlib.Path(video_path)
496496
filename = file_path.stem
497497
extension = file_path.suffix
498-
headers = {"Content-Disposition": f"attachment; filename={filename}{extension}"}
498+
headers = {"Content-Disposition": f'attachment; filename="{filename}{extension}"'}
499499
return FileResponse(
500500
path=video_path,
501501
headers=headers,

0 commit comments

Comments
 (0)