node_modules/router/index.js
/**
 * Send an OPTIONS response.
 *
 * @private
 */
Send an OPTIONS response.
@private
Send an OPTIONS response . @private
function sendOptionsResponse(res, methods) {
  var options = Object.create(null)
  for (var i = 0; i < methods.length; i++) {
    options[methods[i]] = true
  }
  var allow = Object.keys(options).sort().join(', ')
  res.setHeader('Allow', allow)
  res.setHeader('Content-Length', Buffer.byteLength(allow))
  res.setHeader('Content-Type', 'text/plain')
  res.setHeader('X-Content-Type-Options', 'nosniff')
  res.end(allow)
}
function sendOptionsResponse ( res , methods ) { var options = Object . create ( null ) for ( var i = 0 ; i < methods . length ; i ++ ) { options [ methods [ i ] ] = true } var allow = Object . keys ( options ) . sort ( ) . join ( ', ' ) res . setHeader ( 'Allow' , allow ) res . setHeader ( 'Content-Length' , Buffer . byteLength ( allow ) ) res . setHeader ( 'Content-Type' , 'text/plain' ) res . setHeader ( 'X-Content-Type-Options' , 'nosniff' ) res . end ( allow ) }
Send an OPTIONS response.
Send an OPTIONS response .
// build unique method map // construct the allow list // send response