Fix logic for determining content type header.