CDB-3678 Only add the header if api_hostname exists in environment