diff --git a/test/Client/CurlTest.php b/test/Client/CurlTest.php index 4e8403fe59..198b572d6c 100644 --- a/test/Client/CurlTest.php +++ b/test/Client/CurlTest.php @@ -397,4 +397,29 @@ public function testSetCurlOptPostFields() $this->client->send(); $this->assertEquals('foo=bar', $this->client->getResponse()->getBody()); } + + /** + * @group ZF-7683 + * @see https://github.com/zendframework/zend-http/pull/53 + * + * Note: The headers stored in ZF7683-chunked.php are case insensitive + */ + public function testNoCaseSensitiveHeaderName() + { + $this->client->setUri($this->baseuri . 'ZF7683-chunked.php'); + + $adapter = new Adapter\Curl(); + $adapter->setOptions([ + 'curloptions' => [ + CURLOPT_ENCODING => '', + ], + ]); + $this->client->setAdapter($adapter); + $this->client->setMethod('GET'); + $this->client->send(); + + $headers = $this->client->getResponse()->getHeaders(); + $this->assertFalse($headers->has('Transfer-Encoding')); + $this->assertFalse($headers->has('Content-Encoding')); + } } diff --git a/test/Client/_files/ZF7683-chunked.php b/test/Client/_files/ZF7683-chunked.php new file mode 100644 index 0000000000..561fe12bfe --- /dev/null +++ b/test/Client/_files/ZF7683-chunked.php @@ -0,0 +1,4 @@ +