refactor: add early return for health check endpoint in API key authentication middleware

This commit is contained in:
Tudor Stanciu 2025-10-04 03:35:22 +03:00
parent 900f5ad238
commit ae34658fba

View File

@ -11,6 +11,11 @@ export const apiKeyAuth = (
res: Response,
next: NextFunction
): void => {
if (req.path === '/health') {
next();
return;
}
const apiKey = req.header('X-API-Key') || (req.query.apikey as string);
if (!apiKey) {