fix api key
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m4s

This commit is contained in:
harid 2026-05-25 17:43:50 +07:00
parent 2868c329e1
commit 7b22fb2a2d

View file

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