aboutsummaryrefslogtreecommitdiffstats
path: root/components/net
diff options
context:
space:
mode:
authorBastien Orivel <eijebong@bananium.fr>2018-02-28 15:12:19 +0100
committerBastien Orivel <eijebong@bananium.fr>2018-02-28 16:55:35 +0100
commitc072829be08ccd8bfa6f0955d296c07ceeb4a624 (patch)
tree503bf8253ac362aa7c1c2ec2c588f30247b23a1e /components/net
parent9ca18b510f1b075585b2c3cc1f96d06954006f5a (diff)
downloadservo-c072829be08ccd8bfa6f0955d296c07ceeb4a624.tar.gz
servo-c072829be08ccd8bfa6f0955d296c07ceeb4a624.zip
Update flate2 to 1.0
Diffstat (limited to 'components/net')
-rw-r--r--components/net/Cargo.toml2
-rw-r--r--components/net/http_loader.rs2
-rw-r--r--components/net/tests/http_loader.rs4
3 files changed, 4 insertions, 4 deletions
diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml
index da9a2c7393a..4329215010a 100644
--- a/components/net/Cargo.toml
+++ b/components/net/Cargo.toml
@@ -16,7 +16,7 @@ base64 = "0.6"
brotli = "1.0.6"
cookie = "0.10"
devtools_traits = {path = "../devtools_traits"}
-flate2 = "0.2.0"
+flate2 = "1"
hyper = "0.10"
hyper_serde = "0.8"
hyper-openssl = "0.2.2"
diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs
index ea9e1b129d9..c1a8215b06f 100644
--- a/components/net/http_loader.rs
+++ b/components/net/http_loader.rs
@@ -290,7 +290,7 @@ impl StreamedResponse {
let decoder = {
if let Some(ref encoding) = response.headers.get::<ContentEncoding>().cloned() {
if encoding.contains(&Encoding::Gzip) {
- Decoder::Gzip(GzDecoder::new(response)?)
+ Decoder::Gzip(GzDecoder::new(response))
}
else if encoding.contains(&Encoding::Deflate) {
Decoder::Deflate(DeflateDecoder::new(response))
diff --git a/components/net/tests/http_loader.rs b/components/net/tests/http_loader.rs
index b9a84e6d0c3..67e8f9456e9 100644
--- a/components/net/tests/http_loader.rs
+++ b/components/net/tests/http_loader.rs
@@ -394,7 +394,7 @@ fn test_load_when_redirecting_from_a_post_should_rewrite_next_request_as_get() {
fn test_load_should_decode_the_response_as_deflate_when_response_headers_have_content_encoding_deflate() {
let handler = move |_: HyperRequest, mut response: HyperResponse| {
response.headers_mut().set(ContentEncoding(vec![Encoding::Deflate]));
- let mut e = DeflateEncoder::new(Vec::new(), Compression::Default);
+ let mut e = DeflateEncoder::new(Vec::new(), Compression::default());
e.write(b"Yay!").unwrap();
let encoded_content = e.finish().unwrap();
response.send(&encoded_content).unwrap();
@@ -424,7 +424,7 @@ fn test_load_should_decode_the_response_as_deflate_when_response_headers_have_co
fn test_load_should_decode_the_response_as_gzip_when_response_headers_have_content_encoding_gzip() {
let handler = move |_: HyperRequest, mut response: HyperResponse| {
response.headers_mut().set(ContentEncoding(vec![Encoding::Gzip]));
- let mut e = GzEncoder::new(Vec::new(), Compression::Default);
+ let mut e = GzEncoder::new(Vec::new(), Compression::default());
e.write(b"Yay!").unwrap();
let encoded_content = e.finish().unwrap();
response.send(&encoded_content).unwrap();