public static function toPsr(CakeResponse $response)
    {
        $status = $response->statusCode();
        $headers = $response->header();
        if (!isset($headers['Content-Type'])) {
            $headers = static::setContentType($headers, $response);
        }
        $cookies = $response->cookie();
        if ($cookies) {
            $headers['Set-Cookie'] = static::buildCookieHeader($cookies);
        }
        $stream = static::getStream($response);

        return new DiactorosResponse($stream, $status, $headers);
    }