mirror of
https://github.com/nethunterzist/trendyol-analiz
synced 2026-07-01 01:17:04 +00:00
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
This commit is contained in:
@@ -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
|
# API_KEY env var not set — authentication disabled
|
||||||
return
|
return
|
||||||
if not api_key or api_key != API_KEY:
|
if not api_key or api_key != API_KEY:
|
||||||
raise HTTPException(
|
raise HTTPException(status_code=404, detail="Not Found")
|
||||||
status_code=401,
|
|
||||||
detail="Invalid or missing API key"
|
|
||||||
)
|
|
||||||
|
|
||||||
# GS1 Barcode Prefix to Country Mapping (EAN-13 / EAN-8)
|
# GS1 Barcode Prefix to Country Mapping (EAN-13 / EAN-8)
|
||||||
# Source: https://www.gs1.org/standards/id-keys/company-prefix
|
# Source: https://www.gs1.org/standards/id-keys/company-prefix
|
||||||
|
|||||||
Reference in New Issue
Block a user