Skip to content

Commit

Permalink
Fix site-preview path check in Middleware (#3126)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxachun authored Jan 15, 2025
1 parent ad93dfb commit 27d784a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/site/src/middleware/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CustomMiddleware } from "./chain";

export function withPreviewMiddleware(middleware: CustomMiddleware) {
return async (request: NextRequest) => {
if (request.nextUrl.pathname.startsWith("/block-preview/") || request.nextUrl.pathname.startsWith("/site-preview/")) {
if (request.nextUrl.pathname.startsWith("/block-preview/") || request.nextUrl.pathname === "/site-preview") {
// don't apply any other middlewares
return NextResponse.next();
}
Expand Down

0 comments on commit 27d784a

Please sign in to comment.