tests/performance/run.js
/**
   * Add CORS headers, Content-Length, body, HTTP status and answer with the
   * Response Object given.
   * @param {Response} response
   * @param {number} status
   * @param {*} body
   */
Add CORS headers, Content-Length, body, HTTP status and answer with the
Response Object given.
Add CORS headers Content - Length body HTTP status and answer with the Response Object given .
function answerWithCORS(response, status, body) {
    if (Buffer.isBuffer(body)) {
      response.setHeader("Content-Length", body.byteLength);
    }
    response.writeHead(status, {
      "Access-Control-Allow-Origin": "*",
      "Access-Control-Allow-Headers": "*",
      "Access-Control-Allow-Credentials": true,
      "Access-Control-Allow-Methods": "GET, OPTIONS",
    });
    if (body !== undefined) {
      response.end(body);
    } else {
      response.end();
    }
    return;
  }
function answerWithCORS ( response , status , body ) { if ( Buffer . isBuffer ( body ) ) { response . setHeader ( "Content-Length" , body . byteLength ) ; } response . writeHead ( status , { "Access-Control-Allow-Origin" : "*" , "Access-Control-Allow-Headers" : "*" , "Access-Control-Allow-Credentials" : true , "Access-Control-Allow-Methods" : "GET, OPTIONS" , } ) ; if ( body !== undefined ) { response . end ( body ) ; } else { response . end ( ) ; } return ; }
Add CORS headers, Content-Length, body, HTTP status and answer with the
 Response Object given.
Add CORS headers Content - Length body HTTP status and answer with the Response Object given .