File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -236,9 +236,10 @@ async function handleWebSocketWithDispatcher(
236236 const doId = env . DISPATCHER_DO . idFromName ( sessionId ) ;
237237 const stub = env . DISPATCHER_DO . get ( doId ) ;
238238
239- const upgradeRequest = new Request ( 'http://dispatcher/websocket' , {
240- headers : { 'Upgrade' : 'websocket' } ,
241- } ) ;
239+ const upgradeRequest = new Request (
240+ `http://dispatcher/websocket?sessionId=${ encodeURIComponent ( sessionId ) } ` ,
241+ { headers : { 'Upgrade' : 'websocket' } } ,
242+ ) ;
242243 const doResponse = await stub . fetch ( upgradeRequest ) ;
243244
244245 if ( doResponse . webSocket ) {
@@ -295,9 +296,10 @@ async function handleWebSocketWithDispatcher(
295296 const doId = env . DISPATCHER_DO . idFromName ( sessionId ) ;
296297 const stub = env . DISPATCHER_DO . get ( doId ) ;
297298
298- const upgradeRequest = new Request ( 'http://dispatcher/websocket' , {
299- headers : { 'Upgrade' : 'websocket' } ,
300- } ) ;
299+ const upgradeRequest = new Request (
300+ `http://dispatcher/websocket?sessionId=${ encodeURIComponent ( sessionId ) } ` ,
301+ { headers : { 'Upgrade' : 'websocket' } } ,
302+ ) ;
301303 const doResponse = await stub . fetch ( upgradeRequest ) ;
302304
303305 if ( doResponse . webSocket ) {
You can’t perform that action at this time.
0 commit comments