fix: allow public font assets

This commit is contained in:
134 2026-06-25 23:21:58 +08:00
parent 4d6e218e98
commit 045e36b242

View File

@ -79,6 +79,12 @@ export async function proxy(request: NextRequest) {
return NextResponse.next(); 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:速率限制 // 🛡️ 安全检查3:速率限制
// 对API路径应用速率限制 // 对API路径应用速率限制
if (pathname === "/api/chat") { if (pathname === "/api/chat") {
@ -352,6 +358,6 @@ export const config = {
* - favicon.ico (favicon文件) * - favicon.ico (favicon文件)
* - public 文件夹中的文件 * - 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)$).*)",
], ],
}; };