fix: allow public font assets
This commit is contained in:
parent
4d6e218e98
commit
045e36b242
8
proxy.ts
8
proxy.ts
@ -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)$).*)",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user