27 lines
497 B
PHP
27 lines
497 B
PHP
|
<?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 ];
|
||
|
}
|
||
|
}
|