Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions test/Client/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}
4 changes: 4 additions & 0 deletions test/Client/_files/ZF7683-chunked.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
// intentional use of case-insensitive header name
header("Transfer-encoding: chunked");
header("content-encoding: gzip");