@@ -63,7 +63,7 @@ async function loadHar(filename: string) {
6363}
6464
6565// List available HAR files
66- app . get ( '/' , async ( req , res ) => {
66+ app . get ( '/' , async ( _req , res ) => {
6767 try {
6868 const harDir = path . join ( __dirname , 'har' )
6969 const files = await fs . readdir ( harDir )
@@ -168,10 +168,10 @@ app.get('/page/:filename', async (req, res) => {
168168 `/asset/${ filename . replace ( '.har' , '' ) } ` ,
169169 )
170170
171- res . send ( html )
171+ return res . send ( html )
172172 } catch ( error ) {
173173 console . error ( 'Error serving page:' , error )
174- res . status ( 500 ) . send ( 'Error loading page' )
174+ return res . status ( 500 ) . send ( 'Error loading page' )
175175 }
176176} )
177177
@@ -270,10 +270,10 @@ app.get('/page/:filename/gitcasso', async (req, res) => {
270270 html += contentScriptTag
271271 }
272272
273- res . send ( html )
273+ return res . send ( html )
274274 } catch ( error ) {
275275 console . error ( 'Error serving page:' , error )
276- res . status ( 500 ) . send ( 'Error loading page' )
276+ return res . status ( 500 ) . send ( 'Error loading page' )
277277 }
278278} )
279279
@@ -301,13 +301,13 @@ app.get('/asset/:harname/*', async (req, res) => {
301301 res . set ( 'Content-Type' , mimeType )
302302
303303 if ( content . encoding === 'base64' ) {
304- res . send ( Buffer . from ( content . text , 'base64' ) )
304+ return res . send ( Buffer . from ( content . text , 'base64' ) )
305305 } else {
306- res . send ( content . text || '' )
306+ return res . send ( content . text || '' )
307307 }
308308 } catch ( error ) {
309309 console . error ( 'Error serving asset:' , error )
310- res . status ( 404 ) . send ( 'Asset not found' )
310+ return res . status ( 404 ) . send ( 'Asset not found' )
311311 }
312312} )
313313
0 commit comments