From 045e36b24288d686b543443c6ad8568636bb9934 Mon Sep 17 00:00:00 2001 From: 134 Date: Thu, 25 Jun 2026 23:21:58 +0800 Subject: [PATCH] fix: allow public font assets --- proxy.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proxy.ts b/proxy.ts index 8d952f0a9..115c6e2a5 100644 --- a/proxy.ts +++ b/proxy.ts @@ -79,6 +79,12 @@ export async function proxy(request: NextRequest) { return NextResponse.next(); } + // Site fonts are public static assets referenced by global CSS. Redirecting + // them to login prevents the browser from loading the configured typeface. + if (pathname.startsWith("/fonts/")) { + return NextResponse.next(); + } + // 🛡️ 安全检查3:速率限制 // 对API路径应用速率限制 if (pathname === "/api/chat") { @@ -352,6 +358,6 @@ export const config = { * - favicon.ico (favicon文件) * - public 文件夹中的文件 */ - "/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|js|wasm)$).*)", + "/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|js|wasm|woff2?|ttf|otf|eot)$).*)", ], };