fix upload 500: add missing _file_suffix to serve server; fix iOS file picker accept types
This commit is contained in:
@@ -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(...),
|
||||
|
||||
Reference in New Issue
Block a user