1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-18 20:05:34 +02:00

disable brotli if feature is not enabled, faster compression

This commit is contained in:
Nikolay Kim
2018-03-21 08:03:21 -07:00
parent ce6d237cc1
commit d5fa0a9418
4 changed files with 24 additions and 6 deletions

View File

@@ -894,9 +894,16 @@ mod tests {
let resp = HttpResponse::build(StatusCode::OK).finish().unwrap();
assert_eq!(resp.content_encoding(), None);
#[cfg(feature="brotli")]
{
let resp = HttpResponse::build(StatusCode::OK)
.content_encoding(ContentEncoding::Br).finish().unwrap();
assert_eq!(resp.content_encoding(), Some(ContentEncoding::Br));
}
let resp = HttpResponse::build(StatusCode::OK)
.content_encoding(ContentEncoding::Br).finish().unwrap();
assert_eq!(resp.content_encoding(), Some(ContentEncoding::Br));
.content_encoding(ContentEncoding::Gzip).finish().unwrap();
assert_eq!(resp.content_encoding(), Some(ContentEncoding::Gzip));
}
#[test]