public function writeToResponse(ResponseInterface $response): ResponseInterface
    {
        if ($this->entries !== []) {
            $value = $this->getHeaderValue();

            $this->entries = [];

            return $response->withHeader(self::HEADER_NAME, $value);
        }

        return $response;
    }