Closed SchrodingerZhu closed 4 years ago
fn accepts_encoding<State: Send + Sync + 'static>(req: &Request<State>) -> Option<Encoding> { let header = req.header(headers::ACCEPT_ENCODING)?; println!("{:?}", header.iter().collect::<Vec<_>>()); #[cfg(feature = "brotli")] { if header.iter().any(|v| v.as_str() == "br") { return Some(Encoding::BROTLI); } } #[cfg(feature = "gzip")] { if header.iter().any(|v| v.as_str() == "gzip") { return Some(Encoding::GZIP); } } #[cfg(feature = "deflate")] { if header.iter().any(|v| v.as_str() == "deflate") { return Some(Encoding::DEFLATE); } } None }
and we get:
["gzip, deflate"]
which means the value is not spitted. will open a PR for this later.
Yeah... that fix should do for now. Eventually this needs full Content-Encoding handling, which is something I am working on for http-types.
Content-Encoding
and we get:
which means the value is not spitted. will open a PR for this later.