From 164c314f885d963a89ab25730663de4189c75fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Fri, 9 Feb 2024 18:22:07 +0100 Subject: [PATCH] Tests: Align `middleware-mockerver.js` with the `main` branch Remove a redundant Express-targeted `resp.set` call from the `script` handler in `middleware-mockserver.js` as was done on the `main` branch. Closes gh-5413 Ref gh-5397 --- test/middleware-mockserver.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/test/middleware-mockserver.js b/test/middleware-mockserver.js index 9dcf51951..c1fb813e0 100644 --- a/test/middleware-mockserver.js +++ b/test/middleware-mockserver.js @@ -79,13 +79,7 @@ const mocks = { headers[ "access-control-allow-origin" ] = "*"; } - if ( resp.set ) { - resp.set( headers ); - } else { - for ( const key in headers ) { - resp.writeHead( 200, { [ key ]: headers[ key ] } ); - } - } + resp.writeHead( 200, headers ); if ( req.query.callback ) { resp.end( `${ cleanCallback( req.query.callback ) }(${ JSON.stringify( {