Skip to content

Commit 4df252d

Browse files
authored
Merge pull request #2 from ezimuel/fix-case-sensitive-header-handling
Added unit test for zendframework#53
2 parents 7ebd945 + ca523fa commit 4df252d

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

test/Client/CurlTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,29 @@ public function testSetCurlOptPostFields()
397397
$this->client->send();
398398
$this->assertEquals('foo=bar', $this->client->getResponse()->getBody());
399399
}
400+
401+
/**
402+
* @group ZF-7683
403+
* @see https://github.com/zendframework/zend-http/pull/53
404+
*
405+
* Note: The headers stored in ZF7683-chunked.php are case insensitive
406+
*/
407+
public function testNoCaseSensitiveHeaderName()
408+
{
409+
$this->client->setUri($this->baseuri . 'ZF7683-chunked.php');
410+
411+
$adapter = new Adapter\Curl();
412+
$adapter->setOptions([
413+
'curloptions' => [
414+
CURLOPT_ENCODING => '',
415+
],
416+
]);
417+
$this->client->setAdapter($adapter);
418+
$this->client->setMethod('GET');
419+
$this->client->send();
420+
421+
$headers = $this->client->getResponse()->getHeaders();
422+
$this->assertFalse($headers->has('Transfer-Encoding'));
423+
$this->assertFalse($headers->has('Content-Encoding'));
424+
}
400425
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
// intentional use of case-insensitive header name
3+
header("Transfer-encoding: chunked");
4+
header("content-encoding: gzip");

0 commit comments

Comments
 (0)