@@ -497,13 +497,11 @@ export function createApp({
497497 : `${ script } ${ text } ` ;
498498 } ;
499499
500- const viewerResponse = ( c : {
501- req : { raw : Request ; url : string } ;
502- html : ( html : string ) => Response ;
503- } ) => c . html ( withViewerConfig ( withOrigin ( viewerHtml , c ) , c . req . raw ) ) ;
504- app . get ( "/" , viewerResponse ) ;
505- app . get ( "/session/:id" , viewerResponse ) ;
506- app . get ( "/session/:id/s/:surfaceId" , viewerResponse ) ;
500+ const configuredViewerHtml = ( request : Request , url : string ) =>
501+ withViewerConfig ( withOrigin ( viewerHtml , { req : { url } } ) , request ) ;
502+ app . get ( "/" , ( c ) => c . html ( configuredViewerHtml ( c . req . raw , c . req . url ) ) ) ;
503+ app . get ( "/session/:id" , ( c ) => c . html ( configuredViewerHtml ( c . req . raw , c . req . url ) ) ) ;
504+ app . get ( "/session/:id/s/:surfaceId" , ( c ) => c . html ( configuredViewerHtml ( c . req . raw , c . req . url ) ) ) ;
507505 app . get ( "/guide" , ( c ) => c . text ( withOrigin ( guideMarkdown , c ) ) ) ;
508506 app . get ( "/setup" , ( c ) => c . text ( withOrigin ( setupText , c ) ) ) ;
509507 app . get ( "/agent-howto" , ( c ) => c . text ( withOrigin ( agentHowtoText , c ) ) ) ;
0 commit comments