Merge custom headers from Numion

Cherry pick the Numion commits dealing with custom headers.