protected function wrapHttpResponse(\Exception $exception, string $bodyContent): string
    {
        $body = fopen('php://temp', 'rw');
        fputs($body, $bodyContent);
        rewind($body);

        /** @var Response $response */
        $response = (new Response())
            ->withStatus($exception instanceof FlowException ? $exception->getStatusCode() : 500)
            ->withBody(new ContentStream($body))
            ->withHeader('Cache-Control', 'no-store');

        return implode("\r\n", $response->renderHeaders()) . "\r\n\r\n" . $response->getContent();
    }
protected function wrapHttpResponse(\Exception $exception, string $bodyContent): string
    {
        $body = fopen('php://temp', 'rw');
        fputs($body, $bodyContent);
        rewind($body);

        /** @var Response $response */
        $response = (new Response())
            ->withStatus($exception instanceof FlowException ? $exception->getStatusCode() : 500)
            ->withBody(new ContentStream($body))
            ->withHeader('Cache-Control', 'no-store');

        return implode("\r\n", $response->renderHeaders()) . "\r\n\r\n" . $response->getContent();
    }
protected function wrapHttpResponse ( \ Exception $ exception , string $ bodyContent ) : string { $ body = fopen ( 'php://temp' , 'rw' ) ; fputs ( $ body , $ bodyContent ) ; rewind ( $ body ) ; /** @var Response $response */ $ response = ( new Response ( ) ) -> withStatus ( $ exception instanceof FlowException ? $ exception -> getStatusCode ( ) : 500 ) -> withBody ( new ContentStream ( $ body ) ) -> withHeader ( 'Cache-Control' , 'no-store' ) ; return implode ( "\r\n" , $ response -> renderHeaders ( ) ) . "\r\n\r\n" . $ response -> getContent ( ) ; }
Renders an actual HTTP response including the correct status and cache control header.

@param \Exception the exception
@param string $bodyContent
@return string
Renders an actual HTTP response including the correct status and cache control header .