Merge pull request #9001 from electron/net_source_stream_error_patch
net: catch source stream creation failure for content encoding
This commit is contained in:
commit
03b2167f6c
1 changed files with 8 additions and 0 deletions
|
@ -348,6 +348,14 @@ void AtomURLRequest::OnReadCompleted(net::URLRequest* request, int bytes_read) {
|
||||||
DCHECK_EQ(request, request_.get());
|
DCHECK_EQ(request, request_.get());
|
||||||
|
|
||||||
const auto status = request_->status();
|
const auto status = request_->status();
|
||||||
|
if (status.error() == bytes_read &&
|
||||||
|
bytes_read == net::ERR_CONTENT_DECODING_INIT_FAILED) {
|
||||||
|
// When the request job is unable to create a source stream for the
|
||||||
|
// content encoding, we fail the request.
|
||||||
|
DoCancelWithError(net::ErrorToString(net::ERR_CONTENT_DECODING_INIT_FAILED),
|
||||||
|
true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool response_error = false;
|
bool response_error = false;
|
||||||
bool data_ended = false;
|
bool data_ended = false;
|
||||||
|
|
Loading…
Reference in a new issue