Skip to content

Commit 7a8d96e

Browse files
Bugfix: Response body persistence
Bugfix: Response body was being appended to (stream isn't immutable).
1 parent f199981 commit 7a8d96e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/AppWrapper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Slim\App;
99
use Slim\Container;
1010
use Slim\Exception\Exception as SlimException;
11+
use Slim\Http\Headers;
12+
use Slim\Http\Response;
1113

1214
/**
1315
* Wraps a Slim v3 application object as an implementation of the kernel
@@ -43,7 +45,8 @@ public function __construct(App $app)
4345
*/
4446
public function handleRequest(ServerRequestInterface $request)
4547
{
46-
$response = $this->container->get('response');
48+
$headers = new Headers(['Content-Type': 'text/html']);
49+
$response = (new Response(200, $headers))->withProtocolVersion('1.1');
4750

4851
try {
4952
$response = $this->app->callMiddlewareStack($request, $response);

0 commit comments

Comments
 (0)