Skip to content

Commit

Permalink
Do not assume response body is seekable in App::respond. Fixes #1434
Browse files Browse the repository at this point in the history
  • Loading branch information
codeguy committed Aug 12, 2015
1 parent b671071 commit ca438e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Slim/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit ca438e7

Please sign in to comment.