File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ export async function middleware(req: NextRequest) {
56
56
if ( pathname . startsWith ( '/cookies' ) ) {
57
57
response = NextResponse . next ( )
58
58
response . cookies . set ( 'netlifyCookie' , 'true' )
59
+ return response
60
+ }
61
+
62
+ if ( pathname . startsWith ( '/matcher-cookie' ) ) {
63
+ response = NextResponse . next ( )
59
64
response . cookies . set ( 'missingCookie' , 'true' )
60
65
return response
61
66
}
@@ -126,6 +131,7 @@ export const config = {
126
131
'/headers' ,
127
132
{ source : '/static' } ,
128
133
{ source : '/cookies' } ,
134
+ { source : '/matcher-cookie' } ,
129
135
{ source : '/shows/((?!99|88).*)' } ,
130
136
{
131
137
source : '/conditional' ,
Original file line number Diff line number Diff line change
1
+ const MatcherCookie = ( ) => {
2
+ return (
3
+ < div >
4
+ < p > The cookie "missingCookie" should be set to true</ p >
5
+ </ div >
6
+ )
7
+ }
8
+
9
+ export default MatcherCookie
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const Missing = () => {
5
5
return (
6
6
< div >
7
7
< p > Will Check if 'missingCookie' is missing and display headers</ p >
8
- < p > To test go to < Link href = "/cookies " > cookies page</ Link > and come back</ p >
8
+ < p > To test go to < Link href = "/matcher-cookie " > cookies page</ Link > and come back</ p >
9
9
</ div >
10
10
)
11
11
}
Original file line number Diff line number Diff line change 4
4
"description" : " Run Next.js seamlessly on Netlify" ,
5
5
"scripts" : {
6
6
"build:demo" : " cd demos/default && npm run build" ,
7
- "cy:open" : " cypress open --config-file cypress/config/canary .json" ,
7
+ "cy:open" : " cypress open --config-file cypress/config/all .json" ,
8
8
"dev:demo" : " next dev demos/default" ,
9
9
"format" : " run-s format:check-fix:*" ,
10
10
"format:ci" : " run-s format:check:*" ,
You can’t perform that action at this time.
0 commit comments