Fix errors where there are no Content-Encoding headers in the response

Content-Encoding is a not a required header in the spec, but the recent changes introduced a regression where if no Content-Encoding header is set, an exception occurs. This adds validation to the response.