Skip to content

Commit

Permalink
use stream_for() instead of BufferStream
Browse files Browse the repository at this point in the history
  • Loading branch information
fdreamsu committed Sep 25, 2019
1 parent 34ccce4 commit ee76714
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

namespace Swlib\Saber;

use Psr\Http\Message\UriInterface;
use Swlib\Http\BufferStream;
use Swlib\Http\CookiesManagerTrait;
use Swlib\Http\Exception\BadResponseException;
use Swlib\Http\Exception\ClientException;
Expand All @@ -17,6 +15,7 @@
use Swlib\Http\Exception\TooManyRedirectsException;
use Swlib\Util\StringDataParserTrait;
use Swlib\Util\SpecialMarkTrait;
use function Swlib\Http\stream_for;

class Response extends \Swlib\Http\Response
{
Expand Down Expand Up @@ -96,10 +95,7 @@ function __construct(Request $request)
} else {
$body = '';
}

$buffer = new BufferStream();
$buffer->write($body);
$this->withBody($buffer);
$this->withBody(stream_for($body));

/** data parser */
$this->__stringDataParserInitialization($this->body);
Expand Down

0 comments on commit ee76714

Please sign in to comment.