public function headers($name, $value = null, $replace = true) {
        $headers = static::splitHeaders($name, $value);

        if (is_string($headers)) {
            return val($headers, $this->headers);
        }

        foreach ($headers as $name => $value) {
            if ($replace || !isset($this->headers[$name])) {
                $this->headers[$name] = $value;
            } else {
                $this->headers[$name] = array_merge((array)$this->headers, [$value]);
            }
        }
        return $this;
    }