fix upload 500: add missing _file_suffix to serve server; fix iOS file picker accept types

This commit is contained in:
Davide Scaini
2026-04-11 14:12:54 +02:00
parent f4008c0f51
commit 5de9967127
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -612,6 +612,14 @@ async def save_athlete(
_SUPPORTED_SUFFIXES = {".fit", ".gpx", ".tcx", ".fit.gz", ".gpx.gz", ".tcx.gz"}
def _file_suffix(name: str) -> str:
"""Return the effective suffix, including .gz double-extension."""
p = Path(name.lower())
if p.suffix == ".gz":
return p.stem.rsplit(".", 1)[-1].join([".", ".gz"]) if "." in p.stem else ".gz"
return p.suffix
@app.post("/api/upload")
async def upload_activity(
files: list[UploadFile] = File(...),