[Cronet] Cronet fails SDCH-encoded responses with Network error: net::ERR_CONTENT_DECODING_INIT_FAILED (-371) |
|||
Issue descriptionCronet on iOS doesn't support SDCH encoding, but if app explicitly sets Accept-Encoding=sdch and gets response with Content-Encoding=sdch, then request fails with the following error: [1117/162928:ERROR:crn_http_protocol_handler.mm(805)] HttpProtocolHandlerCore - Network error: net::ERR_CONTENT_DECODING_INIT_FAILED (-371) For other unknown encoding types raw response data is passed through to the application, and it could make sense to do the same for SDCH. I have more context for this if necessary.
,
Nov 18 2016
This is a bug. We should fail this case. Cronet iOS should disallow adding accept encoding header.
,
Nov 18 2016
There's some ambiguity in my last comment. Returning ERR_CONTENT_DECODING_INIT_FAILED is working as intended. Cronet should add handling to prevent API client from adding accept encoding header.
,
Nov 21 2016
Does it apply only to SDCH or to any custom accept-encoding? Currently Cronet allows to explicitly set Accept-Encoding header, and passes-through raw response data for encodings which it does not recognize, but errors out specifically for SDCH. Should Cronet differ from Chrome in this regard to allow apps to use their own content decoders?
,
Nov 21 2016
Apps and net embedders should not be able to use their own content decoders (as per our offline conversation). We don't currently enforce that, but we should, and I'd like to move in the direction of enforcing it if possible. Have you explored if the consumer can encapsulate their compression so we don't have to deal with these issues in Cronet?
,
Nov 21 2016
a side note: Cronet Android currently strips Content-Encodings. To be consistent, Cronet iOS could do something similar. https://cs.chromium.org/chromium/src/components/cronet/android/java/src/org/chromium/net/impl/UrlRequestBuilderImpl.java?rcl=0&l=100 @Override public UrlRequestBuilderImpl addHeader(String header, String value) { if (header == null) { throw new NullPointerException("Invalid header name."); } if (value == null) { throw new NullPointerException("Invalid header value."); } if (ACCEPT_ENCODING.equalsIgnoreCase(header)) { Log.w(TAG, "It's not necessary to set Accept-Encoding on requests - cronet will do" + " this automatically for you, and setting it yourself has no " + "effect. See https://crbug.com/581399 for details.", new Exception()); return this; } mRequestHeaders.add(Pair.create(header, value)); return this; }
,
Nov 22 2016
,
Nov 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8c7da89358dd21e60be2725220696f29ef94c234 commit 8c7da89358dd21e60be2725220696f29ef94c234 Author: mef <mef@chromium.org> Date: Wed Nov 30 16:58:23 2016 Pass raw response with Context-Encoding sdch if support is not configured. BUG= 666936 Review-Url: https://codereview.chromium.org/2512263002 Cr-Commit-Position: refs/heads/master@{#435295} [modify] https://crrev.com/8c7da89358dd21e60be2725220696f29ef94c234/components/cronet/ios/test/cronet_http_test.mm [modify] https://crrev.com/8c7da89358dd21e60be2725220696f29ef94c234/net/url_request/url_request_http_job.cc [modify] https://crrev.com/8c7da89358dd21e60be2725220696f29ef94c234/net/url_request/url_request_http_job_unittest.cc
,
Jan 3 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by mef@chromium.org
, Nov 18 2016