Initial commit
This commit is contained in:
27
src/Header/HeaderBag.php
Normal file
27
src/Header/HeaderBag.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\React\Http2\Header;
|
||||
|
||||
use NoccyLabs\React\Http2\Huffman\Codec;
|
||||
use NoccyLabs\React\Http2\Huffman\Dictionary;
|
||||
|
||||
/**
|
||||
* An ordered list of HTTP/2 headers
|
||||
*
|
||||
*
|
||||
*/
|
||||
class HeaderBag
|
||||
{
|
||||
|
||||
private array $headers = [];
|
||||
|
||||
public function __construct(array $headers = [])
|
||||
{
|
||||
foreach ($headers as $name=>$value) $this->append($name, $value);
|
||||
}
|
||||
|
||||
public function append(string $name, string $value)
|
||||
{
|
||||
$this->headers[] = [ $name, $value ];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user