Skip to content

Commit

Permalink
Merge pull request #36 from sirn-se/repeated-heades-fix
Browse files Browse the repository at this point in the history
Allow repeated headers when pulling HTTP messages
  • Loading branch information
sirn-se authored Jan 20, 2024
2 parents b59cf5d + f4fd6aa commit 6d21dfb
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 6d21dfb

Please sign in to comment.