Skip to content

Commit

Permalink
Allow repeated headers when pulling HTTP messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sirn-se committed Jan 19, 2024
1 parent b59cf5d commit f4fd6aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

> PHP version `^8.0`
### `2.1.2`

* Allow repeated headers when pulling HTTP messages (@sirn-se)

### `2.1.1`

* Fix issue with falsy but valid HTTP headers (@axklim)
Expand Down
2 changes: 1 addition & 1 deletion src/Http/HttpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function pull(): MessageInterface
foreach ($headers as $header) {
$parts = explode(':', $header, 2);
if (count($parts) == 2) {
$message = $message->withHeader($parts[0], $parts[1]);
$message = $message->withAddedHeader($parts[0], $parts[1]);
}
}
if ($message instanceof Request) {
Expand Down
5 changes: 1 addition & 4 deletions src/Middleware/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
};
use Stringable;
use WebSocket\Connection;
use WebSocket\Http\{
HttpHandler,
Message as HttpMessage
};
use WebSocket\Http\Message as HttpMessage;
use WebSocket\Message\Message;
use WebSocket\Trait\StringableTrait;

Expand Down

0 comments on commit f4fd6aa

Please sign in to comment.