Skip to content

Commit c3e893d

Browse files
committed
test: adjust test to work with modified config
1 parent 3b628bb commit c3e893d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

demos/middleware/middleware.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export async function middleware(req: NextRequest) {
2121
}
2222

2323
const request = new MiddlewareRequest(req)
24-
if (pathname.startsWith('/static')) {
24+
25+
// skipMiddlewareUrlNormalize next config option is used so we have to try to match both html path and data blob path
26+
if (pathname.startsWith('/static') || pathname.endsWith('static.json')) {
2527
// Unlike NextResponse.next(), this actually sends the request to the origin
2628
const res = await request.next()
2729
const message = `This was static (& escaping test &) but has been transformed in ${req.geo?.city}`

0 commit comments

Comments
 (0)