public function getHeader($name, $default = null)
    {
        if (empty($name)) {
            return $default;
        }

        $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $name));
        if (isset($this->env[$temp])) {
            return $this->env[$temp];
        }

        if (function_exists('apache_request_headers')) {
            // @codeCoverageIgnoreStart
            $method = 'apache_request_headers';
            $headers = $method();
            if (isset($headers[$name])) {
                return $headers[$name];
            }
            $header = strtolower($name);
            foreach ($headers as $key => $value) {
                if (strtolower($key) == $name) {
                    return $value;
                }
            }
        }
        // @codeCoverageIgnoreEnd

        return $default;
    }