From abf37e9abd550f10a50c8274de936c8e06c0fc6d Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 14 Aug 2026 22:21:33 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=BE=E8=A1=8C=20PWA=20manifest/sw?= =?UTF-8?q?=20=E5=85=8D=E7=99=BB=E5=BD=95=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- frontend/src/middleware.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/middleware.ts b/frontend/src/middleware.ts index 0c54b81..3fa6dcb 100644 --- a/frontend/src/middleware.ts +++ b/frontend/src/middleware.ts @@ -2,13 +2,22 @@ import { NextResponse } from "next/server"; import type { NextRequest } from "next/server"; const PUBLIC = ["/login", "/privacy", "/terms"]; +const PUBLIC_ASSETS = [ + "/manifest.webmanifest", + "/sw.js", + "/favicon.ico", + "/icon-192.png", + "/icon-512.png", + "/apple-touch-icon.png", +]; export function middleware(request: NextRequest) { const { pathname } = request.nextUrl; if ( pathname.startsWith("/_next") || pathname.startsWith("/favicon") || - pathname.match(/\.(ico|png|jpg|jpeg|svg|webp|css|js)$/) + PUBLIC_ASSETS.includes(pathname) || + pathname.match(/\.(ico|png|jpg|jpeg|svg|webp|css|js|webmanifest|map)$/) ) { return NextResponse.next(); }