From ebea09d8f40e3f82d5f280a3dccf2b30d6b780d9 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 22 Sep 2023 13:37:26 -0700 Subject: [PATCH] Fix spurious errors with networking tests. --- crates/cargo-test-support/src/registry.rs | 1 + tests/testsuite/publish.rs | 1 + 2 files changed, 2 insertions(+) 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