diff --git a/crates/cargo-test-support/src/registry.rs b/crates/cargo-test-support/src/registry.rs index f70bacf044f..853829c5602 100644 --- a/crates/cargo-test-support/src/registry.rs +++ b/crates/cargo-test-support/src/registry.rs @@ -781,6 +781,7 @@ impl HttpServer { let buf = buf.get_mut(); write!(buf, "HTTP/1.1 {}\r\n", response.code).unwrap(); write!(buf, "Content-Length: {}\r\n", response.body.len()).unwrap(); + write!(buf, "Connection: close\r\n").unwrap(); for header in response.headers { write!(buf, "{}\r\n", header).unwrap(); } diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index 9842d526fd8..67569bf3b6a 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -1965,6 +1965,7 @@ Caused by: headers: HTTP/1.1 400 Content-Length: 7 + Connection: close body: go away