mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 14:49:20 +02:00
Fix AcceptEncoding header (#2501)
This commit is contained in:
@ -473,7 +473,7 @@ async fn test_no_decompress() {
|
||||
.wrap(actix_web::middleware::Compress::default())
|
||||
.service(web::resource("/").route(web::to(|| {
|
||||
let mut res = HttpResponse::Ok().body(STR);
|
||||
res.encoding(header::ContentEncoding::Gzip);
|
||||
res.encode_with(header::ContentEncoding::Gzip);
|
||||
res
|
||||
})))
|
||||
});
|
||||
@ -644,7 +644,9 @@ async fn test_client_brotli_encoding_large_random() {
|
||||
async fn test_client_deflate_encoding() {
|
||||
let srv = actix_test::start(|| {
|
||||
App::new().default_service(web::to(|body: Bytes| {
|
||||
HttpResponse::Ok().encoding(ContentEncoding::Br).body(body)
|
||||
HttpResponse::Ok()
|
||||
.encode_with(ContentEncoding::Brotli)
|
||||
.body(body)
|
||||
}))
|
||||
});
|
||||
|
||||
@ -667,7 +669,9 @@ async fn test_client_deflate_encoding_large_random() {
|
||||
|
||||
let srv = actix_test::start(|| {
|
||||
App::new().default_service(web::to(|body: Bytes| {
|
||||
HttpResponse::Ok().encoding(ContentEncoding::Br).body(body)
|
||||
HttpResponse::Ok()
|
||||
.encode_with(ContentEncoding::Brotli)
|
||||
.body(body)
|
||||
}))
|
||||
});
|
||||
|
||||
@ -685,7 +689,7 @@ async fn test_client_streaming_explicit() {
|
||||
let srv = actix_test::start(|| {
|
||||
App::new().default_service(web::to(|body: web::Payload| {
|
||||
HttpResponse::Ok()
|
||||
.encoding(ContentEncoding::Identity)
|
||||
.encode_with(ContentEncoding::Identity)
|
||||
.streaming(body)
|
||||
}))
|
||||
});
|
||||
@ -710,7 +714,7 @@ async fn test_body_streaming_implicit() {
|
||||
});
|
||||
|
||||
HttpResponse::Ok()
|
||||
.encoding(ContentEncoding::Gzip)
|
||||
.encode_with(ContentEncoding::Gzip)
|
||||
.streaming(Box::pin(body))
|
||||
}))
|
||||
});
|
||||
|
Reference in New Issue
Block a user