]> source.dussan.org Git - jquery.git/commitdiff
Tests: Align `middleware-mockerver.js` with the `main` branch
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Fri, 9 Feb 2024 17:22:07 +0000 (18:22 +0100)
committerGitHub <noreply@github.com>
Fri, 9 Feb 2024 17:22:07 +0000 (18:22 +0100)
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

index 9dcf51951e3f4328d19a38bf1a2748b5fe4eb73c..c1fb813e030f8a8ef90e414fe87ace5acf1f54b8 100644 (file)
@@ -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( {