mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update flate2 to 1.0
This commit is contained in:
parent
9ca18b510f
commit
c072829be0
4 changed files with 7 additions and 7 deletions
|
@ -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"
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue