fix: allow basis transcoder assets for 3d textures
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-05-14 15:08:33 +08:00
parent 1c935bf7ae
commit 95572bd476

View File

@ -72,6 +72,13 @@ export async function proxy(request: NextRequest) {
return NextResponse.next();
}
// three.js KTX2/Basis transcoder assets are public runtime dependencies used
// by the in-browser 3D viewer. Redirecting them to login breaks texture decode
// and leaves generated 3D models as white clay renders.
if (pathname.startsWith("/three/basis/")) {
return NextResponse.next();
}
// 🛡️ 安全检查3:速率限制
// 对API路径应用速率限制
if (pathname === "/api/chat") {
@ -299,6 +306,6 @@ export const config = {
* - favicon.ico (favicon文件)
* - public 文件夹中的文件
*/
"/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
"/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|js|wasm)$).*)",
],
};