const SKIP_HEADERS = [ 'accept-ranges' , 'age' , 'cache-control' , 'date' , 'etag' , 'expires' , 'host' , 'hostname' , 'referer' , 'server' , 'user-agent' , 'vary' , 'x-cache' , 'x-forwarded-proto' , ] ; export function toLabels ( headers , prefix ) { let metadata = { } ; Array . from ( headers ) . forEach ( ( [ key , value ] ) => { if ( SKIP_HEADERS . includes ( key ) ) return ; key = key . replace ( /-/g , '_' ) ; value = value . replace ( /"/g , '' ) ; metadata [ `${ prefix }_${ key }` ] = value ; } ) ; return metadata ; }