src/Leevel/Http/Response.php
public function setHeader(string $key, string $value, bool $replace = true): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        if (true === $replace || !$this->headers->has($key)) {
            $this->headers->set($key, $value);
        }

        return $this;
    }
public function setHeader(string $key, string $value, bool $replace = true): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        if (true === $replace || !$this->headers->has($key)) {
            $this->headers->set($key, $value);
        }

        return $this;
    }
设置响应头.

@param string $key
@param string $value
@param bool   $replace

@return $this