Skip to content

Commit 7492aac

Browse files
committed
test: add x-runtime res header to middleware-conditions
1 parent 38a2f3b commit 7492aac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/fixtures/middleware-conditions/middleware-shared.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { NextResponse } from 'next/server'
44
export function middleware(request: NextRequest) {
55
const response: NextResponse = NextResponse.next()
66

7+
// report Next.js Middleware Runtime (not the execution runtime, but target runtime)
8+
response.headers.append('x-runtime', typeof EdgeRuntime !== 'undefined' ? EdgeRuntime : 'node')
79
response.headers.set('x-hello-from-middleware-res', 'hello')
810

911
return response

0 commit comments

Comments
 (0)