From ca438e786d24d9d96bb3dcb993c33ab8be8af5e9 Mon Sep 17 00:00:00 2001 From: Josh Lockhart Date: Wed, 12 Aug 2015 08:48:37 -0400 Subject: [PATCH] Do not assume response body is seekable in App::respond. Fixes #1434 --- Slim/App.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Slim/App.php b/Slim/App.php index 57ef449a7..2250cffbe 100644 --- a/Slim/App.php +++ b/Slim/App.php @@ -349,7 +349,9 @@ public function respond(ResponseInterface $response) // Body if (!$this->isEmptyResponse($response)) { $body = $response->getBody(); - $body->rewind(); + if ($body->isSeekable()) { + $body->rewind(); + } $settings = $this->container->get('settings'); while (!$body->eof()) { echo $body->read($settings['responseChunkSize']);