diff --git a/routes/modelProxy/index.ts b/routes/modelProxy/index.ts index 685391e..a67d434 100644 --- a/routes/modelProxy/index.ts +++ b/routes/modelProxy/index.ts @@ -6,11 +6,13 @@ import { Context } from "../../types" * @returns */ export const manageModelProxyReq = async (ctx: Context) => { - const { req, headers, logger } = ctx - const auth = headers.get("Authorization") - logger.info(`Start Model Proxy, Authorization: ${auth}`) - if (!auth || auth !== "Bearer sk-21a2ce1c2ee94bc2933798eac1bbcadc") { - return ctx.genResp.forbidden("Authorization required") + const { req, headers, logger, path } = ctx + if (!path.exact("/v1/models")) { + const auth = headers.get("Authorization") + logger.info(`Start Model Proxy, Authorization: ${auth}`) + if (!auth || auth !== "Bearer sk-21a2ce1c2ee94bc2933798eac1bbcadc") { + return ctx.genResp.forbidden("Authorization required") + } } const PROXY_URL = "http://ms-13871-nstruct-lmdeploy-2-0109140455.kscn-tj5-prod2-cloudml.xiaomi.srv"