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");