The tentative SDCH filter (SourceStream::TYPE_SDCH_POSSIBLE) should pass through raw contents unchanged when decoding fails, but right now it issues a meta-refresh.
Details:
When URLRequestHttpJob has sent "Avail-Dictionary" but received a response with only "Content-Encoding: gzip", URLRequestHttpJob adds a tentative SDCH filter to the filter chain. This hack was added to work around the fact that some proxies strip out SDCH encoding header.
When decoding a gzipped resource, SdchSourceStream will fail to find a valid SDCH dictionary id in the response. SdchSourceStream then calls SdchPolicyDelegate::OnDictionaryIdError(). If |possible_pass_through_| (true for tentative Sdch filter), we should pass through the contents unchanged, but we issue a meta-refresh instead.
This is found during a refactoring CL (ab5a1f3c40b48b2a0498e6469f9f8d676a728994). We left the old logic unchanged.
----------------------------------------------------
SdchPolicyDelegate::ErrorRecovery SdchPolicyDelegate::OnDictionaryIdError(
std::string* replace_output) {
if (possible_pass_through_) {
LogCorruptionDetection(net_log_, is_cached_content_,
RESPONSE_TENTATIVE_SDCH);
// Ideally we should return PASS_THROUGH here, but this is done to match
// the old behavior in sdch_filter.cc.
}
-----------------------------------------------------
Comment 1 by xunji...@chromium.org
, Jan 25 2017