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

@@ -41,7 +41,10 @@ async fn test_gzip_empty_body() {
async fn test_accept_header_is_not_changed_if_set() {
let server = server::http(move |req| async move {
assert_eq!(req.headers()["accept"], "application/json");
assert_eq!(req.headers()["accept-encoding"], "gzip");
assert!(req.headers()["accept-encoding"]
.to_str()
.unwrap()
.contains("gzip"));
http::Response::default()
});
@@ -111,7 +114,10 @@ async fn gzip_case(response_size: usize, chunk_size: usize) {
response.extend(&gzipped_content);
let server = server::http(move |req| {
assert_eq!(req.headers()["accept-encoding"], "gzip");
assert!(req.headers()["accept-encoding"]
.to_str()
.unwrap()
.contains("gzip"));
let gzipped = gzipped_content.clone();
async move {