lib/server.js
function replaceResponse(res) {
  // copy for response.headers.hasOwnProperty is undefined case
  // https://github.com/oauthjs/node-oauth2-server/pull/486
  const newResponse = {
    headers: {},
  };
  for (const property in res) {
    if (property !== 'headers') {
      newResponse[property] = res[property];
    }
  }
  for (const field in res.headers) {
    newResponse.headers[field] = res.headers[field];
  }
  newResponse.header = newResponse.headers;
  return newResponse;
}
function replaceResponse(res) {
  // copy for response.headers.hasOwnProperty is undefined case
  // https://github.com/oauthjs/node-oauth2-server/pull/486
  const newResponse = {
    headers: {},
  };
  for (const property in res) {
    if (property !== 'headers') {
      newResponse[property] = res[property];
    }
  }
  for (const field in res.headers) {
    newResponse.headers[field] = res.headers[field];
  }
  newResponse.header = newResponse.headers;
  return newResponse;
}
function replaceResponse ( res ) { // copy for response.headers.hasOwnProperty is undefined case // https://github.com/oauthjs/node-oauth2-server/pull/486 const newResponse = { headers : { } , } ; for ( const property in res ) { if ( property !== 'headers' ) { newResponse [ property ] = res [ property ] ; } } for ( const field in res . headers ) { newResponse . headers [ field ] = res . headers [ field ] ; } newResponse . header = newResponse . headers ; return newResponse ; }
replace response.
replace response .