Skip to content

Commit

Permalink
Closes issue #24. Body must rewind
Browse files Browse the repository at this point in the history
  • Loading branch information
gmponos committed Jun 18, 2019
1 parent 6dc6bc6 commit 5f2c7de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All Notable changes to `gmponos/guzzle_logger` will be documented in this file

## 1.0.1 - 2019-06-18

### Changes
- Fixes [#24](https://github.com/gmponos/guzzle-log-middleware/issues/24). Body MUST rewind on huge responses.

## 1.0.0 - 2018-12-28

### Changes
Expand Down
4 changes: 3 additions & 1 deletion src/Handler/MultiRecordArrayHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ private function formatBody(MessageInterface $message, array $options)
}

if ($stream->getSize() >= 3500) {
return $stream->read(200) . ' (truncated...)';
$summary = $stream->read(200) . ' (truncated...)';
$stream->rewind();
return $summary;
}

$body = $stream->getContents();
Expand Down

0 comments on commit 5f2c7de

Please sign in to comment.