File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
import ironStore from "iron-store" ;
2
2
import cookie from "cookie" ;
3
3
import createDebug from "debug" ;
4
+ import flat from "array.prototype.flat" ;
4
5
5
6
const debug = createDebug ( "next-iron-session" ) ;
6
7
@@ -67,7 +68,7 @@ export async function applySession(
67
68
`next-iron-session: Cookie length is too big ${ cookieValue . length } , browsers will refuse it` ,
68
69
) ;
69
70
}
70
- const existingSetCookie = [ res . getHeader ( "set-cookie" ) || [ ] ] . flat ( ) ;
71
+ const existingSetCookie = flat ( [ res . getHeader ( "set-cookie" ) || [ ] ] ) ;
71
72
res . setHeader ( "set-cookie" , [ ...existingSetCookie , cookieValue ] ) ;
72
73
return cookieValue ;
73
74
} ,
@@ -77,7 +78,7 @@ export async function applySession(
77
78
...cookieOptions ,
78
79
maxAge : 0 ,
79
80
} ) ;
80
- const existingSetCookie = [ res . getHeader ( "set-cookie" ) || [ ] ] . flat ( ) ;
81
+ const existingSetCookie = flat ( [ res . getHeader ( "set-cookie" ) || [ ] ] ) ;
81
82
res . setHeader ( "set-cookie" , [ ...existingSetCookie , cookieValue ] ) ;
82
83
} ,
83
84
} ;
Original file line number Diff line number Diff line change 32
32
{
33
33
"targets" : {
34
34
"node" : " 10"
35
- },
36
- "useBuiltIns" : " usage" ,
37
- "corejs" : 3
35
+ }
38
36
}
39
37
]
40
38
]
81
79
]
82
80
},
83
81
"dependencies" : {
82
+ "array.prototype.flat" : " ^1.2.3" ,
84
83
"clone" : " ^2.1.2" ,
85
84
"cookie" : " ^0.4.1" ,
86
85
"debug" : " ^4.1.1" ,
You can’t perform that action at this time.
0 commit comments