Improved header handling when passing through the response to client.