From 59f37624a82635962f04c98f31aed122e539a89e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 11 Apr 2022 13:29:45 +0200 Subject: [PATCH] [HttpClient] Fix sending content-length when streaming the body --- Test/HttpClientTestCase.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Test/HttpClientTestCase.php b/Test/HttpClientTestCase.php index ddc5324..bce7a85 100644 --- a/Test/HttpClientTestCase.php +++ b/Test/HttpClientTestCase.php @@ -332,11 +332,16 @@ public function test304() $this->assertSame('', $response->getContent(false)); } - public function testRedirects() + /** + * @testWith [[]] + * [["Content-Length: 7"]] + */ + public function testRedirects(array $headers = []) { $client = $this->getHttpClient(__FUNCTION__); $response = $client->request('POST', 'http://localhost:8057/301', [ 'auth_basic' => 'foo:bar', + 'headers' => $headers, 'body' => function () { yield 'foo=bar'; },