index.js
function getFirstHeader (req, header) {
  const value = req.headers[header]
  return (Array.isArray(value) ? value[0] : value).split(', ')[0]
}
function getFirstHeader (req, header) {
  const value = req.headers[header]
  return (Array.isArray(value) ? value[0] : value).split(', ')[0]
}
function getFirstHeader ( req , header ) { const value = req . headers [ header ] return ( Array . isArray ( value ) ? value [ 0 ] : value ) . split ( ', ' ) [ 0 ] }
In case there's more than one header of a given name, we want the first one as it should be the one that was added by the first proxy in the chain
In case there s more than one header of a given name we want the first one as it should be the one that was added by the first proxy in the chain