Update /files/ upload response to match RTVI format, rather than inventing a new one

This commit is contained in:
mattie ruth backman
2026-02-04 17:04:37 -05:00
parent 267c86e596
commit 96e06d2401

View File

@@ -308,9 +308,10 @@ def _setup_webrtc_routes(app: FastAPI, args: argparse.Namespace):
# Use original filename only for format/mime in response
original_name = Path(file.filename or "").name
media_type, _ = mimetypes.guess_type(original_name, strict=False)
# Return the file as a URL that can be used in the client, matching the format of RTVIFile
return {
"name": original_name,
"source": f"/files/{safe_name}",
"source": {"type": "url", "url": f"/files/{safe_name}"},
"format": media_type,
}