Brotli support (#791)

This commit is contained in:
EnokMan
2020-02-19 14:49:11 -06:00
committed by GitHub
parent 7622c75064
commit f831d62da0
9 changed files with 400 additions and 103 deletions

View File

@@ -12,7 +12,16 @@ async fn auto_headers() {
assert_eq!(req.headers()["accept"], "*/*");
assert_eq!(req.headers().get("user-agent"), None);
if cfg!(feature = "gzip") {
assert_eq!(req.headers()["accept-encoding"], "gzip");
assert!(req.headers()["accept-encoding"]
.to_str()
.unwrap()
.contains("gzip"));
}
if cfg!(feature = "brotli") {
assert!(req.headers()["accept-encoding"]
.to_str()
.unwrap()
.contains("br"));
}
http::Response::default()