fix: sw.js not found on subdomain

This commit is contained in:
DIYgod 2022-09-06 19:25:24 +01:00 committed by Runjuu
parent 8adddc06c9
commit 0b3bcd1aa1
1 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,9 @@ export default async function middleware(req: NextRequest) {
if (tenant) {
const url = req.nextUrl.clone()
url.pathname = `/_site/${tenant}${url.pathname}`
if (url.pathname !== "/ipfs-gateway-sw.js") {
url.pathname = `/_site/${tenant}${url.pathname}`
}
return NextResponse.rewrite(url)
}