File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1616,16 +1616,20 @@ export default class NextNodeServer extends BaseServer<
16161616 return { finished : true }
16171617 }
16181618
1619- for ( let [ key , value ] of result . response . headers ) {
1620- if ( key . toLowerCase ( ) !== 'set-cookie' ) continue
1619+ // Split compound (comma-separated) set-cookie headers
1620+ if ( result . response . headers . has ( 'set-cookie' ) ) {
1621+ const cookies = result . response . headers
1622+ . getSetCookie ( )
1623+ . flatMap ( ( maybeCompoundCookie ) =>
1624+ splitCookiesString ( maybeCompoundCookie )
1625+ )
16211626
1622- // Clear existing header.
1623- result . response . headers . delete ( key )
1627+ // Clear existing header(s)
1628+ result . response . headers . delete ( 'set-cookie' )
16241629
16251630 // Append each cookie individually.
1626- const cookies = splitCookiesString ( value )
16271631 for ( const cookie of cookies ) {
1628- result . response . headers . append ( key , cookie )
1632+ result . response . headers . append ( 'set-cookie' , cookie )
16291633 }
16301634
16311635 // Add cookies to request meta.
You can’t perform that action at this time.
0 commit comments