mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 06:39:22 +02:00
Remove content_length from ResponseBuilder (#1491)
* Remove content_length since it'll be overwritten by the response body. FIXES #1439 * Add setting of Content-Length to the no_chunking function * Add changes and migration documentations * Update MIGRATION.md Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> Co-authored-by: Rob Ede <robjtede@icloud.com> Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
This commit is contained in:
@ -275,7 +275,7 @@ async fn test_h2_head_binary() {
|
||||
let mut srv = test_server(move || {
|
||||
HttpService::build()
|
||||
.h2(|_| {
|
||||
ok::<_, ()>(Response::Ok().content_length(STR.len() as u64).body(STR))
|
||||
ok::<_, ()>(Response::Ok().body(STR))
|
||||
})
|
||||
.openssl(ssl_acceptor())
|
||||
.map_err(|_| ())
|
||||
|
@ -281,7 +281,7 @@ async fn test_h2_head_binary() {
|
||||
let mut srv = test_server(move || {
|
||||
HttpService::build()
|
||||
.h2(|_| {
|
||||
ok::<_, ()>(Response::Ok().content_length(STR.len() as u64).body(STR))
|
||||
ok::<_, ()>(Response::Ok().body(STR))
|
||||
})
|
||||
.rustls(ssl_acceptor())
|
||||
})
|
||||
|
@ -490,7 +490,7 @@ async fn test_h1_head_binary() {
|
||||
let mut srv = test_server(|| {
|
||||
HttpService::build()
|
||||
.h1(|_| {
|
||||
ok::<_, ()>(Response::Ok().content_length(STR.len() as u64).body(STR))
|
||||
ok::<_, ()>(Response::Ok().body(STR))
|
||||
})
|
||||
.tcp()
|
||||
})
|
||||
|
Reference in New Issue
Block a user