Add Header::responseHeaders() method

This commit is contained in:
Giuseppe Criscione 2018-09-01 16:30:28 +02:00
parent 26e070b661
commit 2752097f95

View File

@ -80,6 +80,16 @@ class Header
header($fieldName . ': ' . trim($fieldValue));
}
public static function responseHeaders()
{
$headers = array();
foreach (headers_list() as $header) {
list($key, $value) = explode(':', $header, 2);
$headers[$key] = trim($value);
}
return $headers;
}
public static function contentType($mimeType)
{
static::send('Content-Type', $mimeType);