mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
21 lines
623 B
TypeScript
21 lines
623 B
TypeScript
import { NextResponse } from 'next/server'
|
|
import * as react from 'library-with-exports/react'
|
|
import * as serverFavoringBrowser from 'library-with-exports/server-favoring-browser'
|
|
import * as serverFavoringEdge from 'library-with-exports/server-favoring-edge'
|
|
|
|
export function middleware() {
|
|
const response = NextResponse.next()
|
|
|
|
response.headers.set('x-react-condition', react.condition)
|
|
response.headers.set(
|
|
'x-server-favoring-browser-condition',
|
|
serverFavoringBrowser.condition
|
|
)
|
|
response.headers.set(
|
|
'x-server-favoring-edge-condition',
|
|
serverFavoringEdge.condition
|
|
)
|
|
|
|
return response
|
|
}
|