File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export async function middleware(req: NextRequest) {
12
12
// Next 13 request header mutation functionality
13
13
const headers = new Headers ( req . headers )
14
14
debugger ;
15
- headers . set ( 'x-from-middleware ' , 'hello-from-middleware ' )
15
+ headers . set ( 'x-hello ' , 'world ' )
16
16
return NextResponse . next ( {
17
17
request : {
18
18
headers
@@ -36,12 +36,6 @@ export async function middleware(req: NextRequest) {
36
36
return res
37
37
}
38
38
39
- if ( pathname . startsWith ( '/api/hello' ) ) {
40
- // Add a header to the request
41
- req . headers . set ( 'x-hello' , 'world' )
42
- return request . next ( )
43
- }
44
-
45
39
if ( pathname . startsWith ( '/api/geo' ) ) {
46
40
req . headers . set ( 'x-geo-country' , req . geo . country )
47
41
req . headers . set ( 'x-geo-region' , req . geo . region )
You can’t perform that action at this time.
0 commit comments