public function getHeader($name, $default = null, $first = true)
    {
        if (!isset($this->headers[$name])) {
            return $default;
        }

        if (is_array($this->headers[$name]) && $first) {
            return current($this->headers[$name]);
        }

        return $this->headers[$name];
    }