File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
packages/qwik-city/src/middleware/request-handler Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,20 @@ export function createRequestEvent(
102
102
} else {
103
103
status = statusOrResponse . status ;
104
104
statusOrResponse . headers . forEach ( ( value , key ) => {
105
+ if ( key . toLowerCase ( ) === 'set-cookie' ) {
106
+ return ;
107
+ }
105
108
headers . append ( key , value ) ;
106
109
} ) ;
110
+ statusOrResponse . headers . getSetCookie ( ) . forEach ( ( ck ) => {
111
+ const index = ck . indexOf ( '=' ) ;
112
+ if ( index === - 1 ) {
113
+ return ;
114
+ }
115
+ const key = ck . slice ( 0 , index ) . trim ( ) ;
116
+ const value = ck . slice ( index + 1 ) . trim ( ) ;
117
+ cookie . set ( key , value ) ;
118
+ } ) ;
107
119
if ( statusOrResponse . body ) {
108
120
const writableStream = requestEv . getWritableStream ( ) ;
109
121
statusOrResponse . body . pipeTo ( writableStream ) ;
You can’t perform that action at this time.
0 commit comments