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
This commit is contained in:
Michał Gołębiowski-Owczarek 2024-02-09 18:22:07 +01:00 committed by GitHub
parent ba6ba5a4c1
commit 164c314f88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View 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( {