File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
tests/fixtures/middleware-i18n Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,15 @@ export async function middleware(request: NextRequest) {
66
77 if ( response ) {
88 response . headers . append ( 'Deno' in globalThis ? 'x-deno' : 'x-node' , Date . now ( ) . toString ( ) )
9+ console . error ( '[middleware] adding x-runtime' )
910 // report Next.js Middleware Runtime (not the execution runtime, but target runtime)
1011 // @ts -expect-error EdgeRuntime global not declared
1112 response . headers . append ( 'x-runtime' , typeof EdgeRuntime !== 'undefined' ? EdgeRuntime : 'node' )
1213 response . headers . set ( 'x-hello-from-middleware-res' , 'hello' )
14+
15+ return response
16+ } else {
17+ console . error ( '[middleware] NOT adding x-runtime' )
1318 }
1419}
1520
@@ -120,6 +125,7 @@ const getResponse = (request: NextRequest) => {
120125 }
121126
122127 if ( url . pathname . includes ( '/json' ) ) {
128+ console . error ( '[middleware] hitting json stuff' )
123129 return NextResponse . json ( {
124130 requestUrlPathname : new URL ( request . url ) . pathname ,
125131 nextUrlPathname : request . nextUrl . pathname ,
You can’t perform that action at this time.
0 commit comments