Implemented header packing logic

This commit is contained in:
2024-02-25 15:49:14 +01:00
parent ff824cdaba
commit b706afaf67
4 changed files with 62 additions and 7 deletions

View File

@ -26,5 +26,22 @@ class HeaderPackerTest extends \PHPUnit\Framework\TestCase
}
public function testPackingExamplesFromRfc7541()
{
$packer = new HeaderPacker();
}
$expect = "\x82\x86\x84\x41\x8c\xf1\xe3\xc2\xe5\xf2\x3a\x6b\xa0\xab\x90\xf4\xff";
$in = new HeaderBag([
':method' => 'GET',
':scheme' => 'http',
':path' => '/',
':authority' => 'www.example.com'
]);
$out = $packer->packHeaders($in);
$this->assertEquals($expect, $out);
}
}