Skip to content

Commit

Permalink
feat: add HTTP3 (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
rancoud authored Jan 17, 2024
1 parent 9d80af1 commit c3c5a37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Message/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trait MessageTrait

protected static string $patternHeaderValue = "@^[ \t\x21-\x7E\x80-\xFF]*$@";

protected static array $validProtocols = ['0.9', '1.0', '1.1', '2', '2.0'];
protected static array $validProtocols = ['0.9', '1.0', '1.1', '2', '2.0', '3'];

protected array $headers = [];

Expand Down
5 changes: 4 additions & 1 deletion tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@ public function testCanConstructWithProtocolVersion(): void

$r = new Response(200, [], null, '2');
static::assertSame('2', $r->getProtocolVersion());

$r = new Response(200, [], null, '3');
static::assertSame('3', $r->getProtocolVersion());
}

public function testRaiseExceptionConstructWithProtocolVersion(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Protocol Version must be 0.9 or 1.0 or 1.1 or 2');
$this->expectExceptionMessage('Protocol Version must be 0.9 or 1.0 or 1.1 or 2 or 2.0 or 3');

new Response(200, [], null, '1000');
}
Expand Down

0 comments on commit c3c5a37

Please sign in to comment.