lib/index.js
function validCorsPreflight(request) {
  if (request.method === 'OPTIONS' && request.headers.has('access-control-request-headers')) {
    return request.headers.get('access-control-request-headers').split(',').map(function (header) {
      return header.trim();
    }).includes('authorization');
  } else {
    return false;
  }
}
function validCorsPreflight(request) {
  if (request.method === 'OPTIONS' && request.headers.has('access-control-request-headers')) {
    return request.headers.get('access-control-request-headers').split(',').map(function (header) {
      return header.trim();
    }).includes('authorization');
  } else {
    return false;
  }
}
function validCorsPreflight ( request ) { if ( request . method === 'OPTIONS' && request . headers . has ( 'access-control-request-headers' ) ) { return request . headers . get ( 'access-control-request-headers' ) . split ( ',' ) . map ( function ( header ) { return header . trim ( ) ; } ) . includes ( 'authorization' ) ; } else { return false ; } }
Checks if an OPTIONS request with the access-control-request-headers containing authorization is being made
@param request
@returns {boolean}
Checks if an OPTIONS request with the access - control - request - headers containing authorization is being made