Skip to content

Commit ee76714

Browse files
committed
use stream_for() instead of BufferStream
1 parent 34ccce4 commit ee76714

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Response.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
namespace Swlib\Saber;
99

10-
use Psr\Http\Message\UriInterface;
11-
use Swlib\Http\BufferStream;
1210
use Swlib\Http\CookiesManagerTrait;
1311
use Swlib\Http\Exception\BadResponseException;
1412
use Swlib\Http\Exception\ClientException;
@@ -17,6 +15,7 @@
1715
use Swlib\Http\Exception\TooManyRedirectsException;
1816
use Swlib\Util\StringDataParserTrait;
1917
use Swlib\Util\SpecialMarkTrait;
18+
use function Swlib\Http\stream_for;
2019

2120
class Response extends \Swlib\Http\Response
2221
{
@@ -96,10 +95,7 @@ function __construct(Request $request)
9695
} else {
9796
$body = '';
9897
}
99-
100-
$buffer = new BufferStream();
101-
$buffer->write($body);
102-
$this->withBody($buffer);
98+
$this->withBody(stream_for($body));
10399

104100
/** data parser */
105101
$this->__stringDataParserInitialization($this->body);

0 commit comments

Comments
 (0)