diff --git a/main.py b/main.py index db1dec3..0b8bbfa 100644 --- a/main.py +++ b/main.py @@ -50,16 +50,16 @@ app, rt = fast_app( app.mount("/Logo", StaticFiles(directory="Logo"), name="Logo") -# --- LECTURE DIRECTE EN RAM (Contournement du bug FastHTML & RAID) --- -@app.get("/Media/{fname:path}") -def get_media(fname: str): +# --- LECTURE EN RAM (Syntaxe Native FastHTML) --- +@rt('/Media/{fname}') +def get(fname: str): chemin = os.path.join(dossier_media, fname) try: - # Lecture binaire brute qui ignore les caprices de métadonnées du disque with open(chemin, "rb") as f: return Response(content=f.read(), media_type="image/png") except Exception as e: - return HTMLResponse(f"