Skip to content

Commit

Permalink
Merge pull request #40 from sirn-se/headerfix
Browse files Browse the repository at this point in the history
Allow additional content in Connection header during handshake
  • Loading branch information
sirn-se authored Feb 16, 2024
2 parents 6d21dfb + 7cf68ca commit feb6fd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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.3`

* Allow additional content in Connection header during handshake (@sirn-se)

### `2.1.2`

* Allow repeated headers when pulling HTTP messages (@sirn-se)
Expand Down
2 changes: 1 addition & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ protected function performHandshake(Connection $connection): ServerRequest
);
}
$connectionHeader = trim($request->getHeaderLine('Connection'));
if (strtolower($connectionHeader) != 'upgrade') {
if (!str_contains('upgrade', strtolower($connectionHeader))) {
throw new HandshakeException(
"Handshake request with invalid Connection header: '{$connectionHeader}'",
$response->withStatus(426)
Expand Down

0 comments on commit feb6fd3

Please sign in to comment.