From 20bae48ea97af0b4381c64ea8dd7dc39033e72b4 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Wed, 3 Jun 2026 15:41:55 -0400 Subject: [PATCH] add ot HEAD --- backend/endpoints/roms/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/endpoints/roms/__init__.py b/backend/endpoints/roms/__init__.py index a013cd209..06f2407b0 100644 --- a/backend/endpoints/roms/__init__.py +++ b/backend/endpoints/roms/__init__.py @@ -868,6 +868,12 @@ async def head_rom_content( files = [f for f in files if f.id in file_id_values] files.sort(key=lambda x: x.file_name) + if not files: + raise HTTPException( + status_code=status.HTTP_404_NOT_FOUND, + detail=f"No files found for ROM {id}", + ) + # Serve the file directly in development mode for emulatorjs if DEV_MODE: if len(files) == 1: @@ -945,9 +951,6 @@ async def get_rom_content( files = [f for f in files if f.id in file_id_values] files.sort(key=lambda x: x.file_name) - # When no files match (e.g. a stale `file_ids` the player remembered from - # before a rename gave the file a new id), return a clean 404 instead of - # building an empty `.m3u` ZIP that nginx aborts as a 0-byte response. See #3470. if not files: raise HTTPException( status_code=status.HTTP_404_NOT_FOUND,