From: Michał Gołębiowski-Owczarek Date: Fri, 9 Feb 2024 17:22:07 +0000 (+0100) Subject: Tests: Align `middleware-mockerver.js` with the `main` branch X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=164c314f885d963a89ab25730663de4189c75fc6;p=jquery.git 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 --- 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( {