import { ReportingConfig } from '../../' ; import { ConditionalHeaders } from './' ; export const getConditionalHeaders = ( config , filteredHeaders ) => { const { kbnConfig } = config ; const [ hostname , port , basePath , protocol ] = [ config . get ( 'kibanaServer' , 'hostname' ) , config . get ( 'kibanaServer' , 'port' ) , kbnConfig . get ( 'server' , 'basePath' ) , config . get ( 'kibanaServer' , 'protocol' ) , ] as [ string , number , string , string ] ; const conditionalHeaders = { headers : filteredHeaders , conditions : { hostname : hostname ? hostname . toLowerCase ( ) : hostname , port , basePath , protocol , } , } ; return conditionalHeaders ; } ;