mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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:
parent
ba6ba5a4c1
commit
164c314f88
@ -79,13 +79,7 @@ const mocks = {
|
|||||||
headers[ "access-control-allow-origin" ] = "*";
|
headers[ "access-control-allow-origin" ] = "*";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( resp.set ) {
|
resp.writeHead( 200, headers );
|
||||||
resp.set( headers );
|
|
||||||
} else {
|
|
||||||
for ( const key in headers ) {
|
|
||||||
resp.writeHead( 200, { [ key ]: headers[ key ] } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( req.query.callback ) {
|
if ( req.query.callback ) {
|
||||||
resp.end( `${ cleanCallback( req.query.callback ) }(${ JSON.stringify( {
|
resp.end( `${ cleanCallback( req.query.callback ) }(${ JSON.stringify( {
|
||||||
|
Loading…
Reference in New Issue
Block a user