mirror of
https://github.com/servo/servo.git
synced 2025-07-25 16:20:36 +01:00
Flatten implementation of net::http_response::HttpResponse
.
This commit is contained in:
parent
50c6d937a5
commit
12dfe6ff28
1 changed files with 13 additions and 13 deletions
|
@ -198,19 +198,19 @@ pub trait HttpResponse: Read {
|
||||||
"HTTP/1.1".to_owned()
|
"HTTP/1.1".to_owned()
|
||||||
}
|
}
|
||||||
fn content_encoding(&self) -> Option<Encoding> {
|
fn content_encoding(&self) -> Option<Encoding> {
|
||||||
self.headers().get::<ContentEncoding>().and_then(|h| {
|
let encodings = match self.headers().get::<ContentEncoding>() {
|
||||||
match *h {
|
Some(&ContentEncoding(ref encodings)) => encodings,
|
||||||
ContentEncoding(ref encodings) => {
|
None => return None,
|
||||||
if encodings.contains(&Encoding::Gzip) {
|
};
|
||||||
Some(Encoding::Gzip)
|
if encodings.contains(&Encoding::Gzip) {
|
||||||
} else if encodings.contains(&Encoding::Deflate) {
|
Some(Encoding::Gzip)
|
||||||
Some(Encoding::Deflate)
|
} else if encodings.contains(&Encoding::Deflate) {
|
||||||
} else if encodings.contains(&Encoding::EncodingExt("br".to_owned())) {
|
Some(Encoding::Deflate)
|
||||||
Some(Encoding::EncodingExt("br".to_owned()))
|
} else if encodings.contains(&Encoding::EncodingExt("br".to_owned())) {
|
||||||
} else { None }
|
Some(Encoding::EncodingExt("br".to_owned()))
|
||||||
}
|
} else {
|
||||||
}
|
None
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue