Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 871dda0

Browse files
committed
Added the unit test for #53
1 parent be4c9b6 commit 871dda0

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

test/Client/CurlTest.php

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