public function getHeader($field)
    {
        $ucField = strtoupper($field);

        if ($ucField === 'SET-COOKIE' && $this->cookies) {
            $result = array_values($this->cookies);
        } elseif (isset($this->ucHeaders[$ucField])) {
            $field = $this->ucHeaders[$ucField];
            $result = $this->headers[$field];
        } else {
            throw new HTTPException(
                sprintf('Header field is not assigned: %s', $field)
            );
        }

        return isset($result[1]) ? $result : $result[0];
    }