From 7b22fb2a2df815d9c1a521cd6e51fa0aba6d0844 Mon Sep 17 00:00:00 2001 From: harid Date: Mon, 25 May 2026 17:43:50 +0700 Subject: [PATCH] fix api key --- src/middlewares/authInternal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middlewares/authInternal.ts b/src/middlewares/authInternal.ts index 8d29ceb6..d3d9a5b6 100644 --- a/src/middlewares/authInternal.ts +++ b/src/middlewares/authInternal.ts @@ -7,7 +7,7 @@ import HttpStatus from "../interfaces/http-status"; export async function handleInternalAuth(request: express.Request) { // รองรับ header หลายรูปแบบ const apiKey = - request.headers["api-key"] || request.headers["apikey"]; + request.headers["api-key"] || request.headers["api_key"] || request.headers["apikey"]; if (!apiKey || typeof apiKey !== "string") { throw new HttpError(HttpStatus.UNAUTHORIZED, "API Key is required");