Skip to content

Commit 5f2c7de

Browse files
committed
Closes issue #24. Body must rewind
1 parent 6dc6bc6 commit 5f2c7de

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

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

5+
## 1.0.1 - 2019-06-18
6+
7+
### Changes
8+
- Fixes [#24](https://github.com/gmponos/guzzle-log-middleware/issues/24). Body MUST rewind on huge responses.
9+
510
## 1.0.0 - 2018-12-28
611

712
### Changes

src/Handler/MultiRecordArrayHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ private function formatBody(MessageInterface $message, array $options)
150150
}
151151

152152
if ($stream->getSize() >= 3500) {
153-
return $stream->read(200) . ' (truncated...)';
153+
$summary = $stream->read(200) . ' (truncated...)';
154+
$stream->rewind();
155+
return $summary;
154156
}
155157

156158
$body = $stream->getContents();

0 commit comments

Comments
 (0)