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
7 changes: 6 additions & 1 deletion app_distribution_server/routers/app_files_router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Literal
from urllib.parse import quote

from fastapi import APIRouter, Request, Response
from fastapi.responses import HTMLResponse
Expand Down Expand Up @@ -68,8 +69,12 @@ async def get_app_file(
)
file_name = f"{build_info.app_title} {build_info.bundle_version}{created_at_prefix}"

# Encode the filename for HTTP headers
safe_filename = quote(file_name)
content_disposition = f"attachment; filename*=UTF-8''{safe_filename}.{file_type}"

return Response(
content=app_file_content,
media_type="application/octet-stream",
headers={"Content-Disposition": f"attachment; filename={file_name}.{file_type}"},
headers={"Content-Disposition": content_disposition},
)