mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #5898 - glennw:corrupt-gz, r=jdm
<!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5898) <!-- Reviewable:end -->
This commit is contained in:
commit
738f006afe
1 changed files with 10 additions and 2 deletions
|
@ -331,8 +331,16 @@ reason: \"certificate verify failed\" }]";
|
|||
match encoding_str {
|
||||
Some(encoding) => {
|
||||
if encoding == "gzip" {
|
||||
let mut response_decoding = GzDecoder::new(response).unwrap();
|
||||
send_data(&mut response_decoding, start_chan, metadata, classifier);
|
||||
let result = GzDecoder::new(response);
|
||||
match result {
|
||||
Ok(mut response_decoding) => {
|
||||
send_data(&mut response_decoding, start_chan, metadata, classifier);
|
||||
}
|
||||
Err(err) => {
|
||||
send_error(metadata.final_url, err.to_string(), start_chan);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if encoding == "deflate" {
|
||||
let mut response_decoding = DeflateDecoder::new(response);
|
||||
send_data(&mut response_decoding, start_chan, metadata, classifier);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue