diff --git a/src/Http/MessageTrait.php b/src/Http/MessageTrait.php index 93c7cd50..a835ba0e 100644 --- a/src/Http/MessageTrait.php +++ b/src/Http/MessageTrait.php @@ -111,7 +111,7 @@ trait MessageTrait */ public function getHeader($name) { - return $this->headers->get($name, null, false); + return $this->headers->all($name); } /** diff --git a/tests/Unit/Http/MessageTraitResponseTest.php b/tests/Unit/Http/MessageTraitResponseTest.php index 33e8dc6b..8ced6560 100644 --- a/tests/Unit/Http/MessageTraitResponseTest.php +++ b/tests/Unit/Http/MessageTraitResponseTest.php @@ -74,6 +74,11 @@ class MessageTraitResponseTest extends TestCase $this->assertEquals(['bar'], $newMessage->getHeader('Foo')); $this->assertEquals([], $newMessage->getHeader('LoremIpsum')); + + $newMessage = $message + ->withHeader('foo', 'bar') + ->withAddedHeader('foo', 'batz'); + $this->assertEquals(['bar', 'batz'], $newMessage->getHeader('foo')); } /**