From 4c6320f710e3ae0bbac06ca28128dcefbe28a42a Mon Sep 17 00:00:00 2001 From: furkanyigit34 Date: Mon, 18 May 2026 12:37:07 +0300 Subject: [PATCH] security: auth hatasi 401 yerine 404 don Ne yaptik: - verify_api_key: HTTPException 401 -> 404, detail 'Not Found' Neden yaptik: - API key'siz erisimde JSON hata mesaji gorunuyordu - 404 ile endpoint yokmus gibi gozukur, domain ifsa olmaz --- backend/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/main.py b/backend/main.py index e0ff5a5..81ca0fc 100644 --- a/backend/main.py +++ b/backend/main.py @@ -65,10 +65,7 @@ async def verify_api_key(request: Request, api_key: Optional[str] = Security(API # API_KEY env var not set — authentication disabled return if not api_key or api_key != API_KEY: - raise HTTPException( - status_code=401, - detail="Invalid or missing API key" - ) + raise HTTPException(status_code=404, detail="Not Found") # GS1 Barcode Prefix to Country Mapping (EAN-13 / EAN-8) # Source: https://www.gs1.org/standards/id-keys/company-prefix