Skip to content

Commit 6567994

Browse files
author
Andrey Oprokidnev
committed
clone body instead of request
1 parent 1bf352f commit 6567994

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Http/Client.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,18 @@ public function __construct($dsn)
6060
* {@inheritdoc}
6161
*/
6262
public function sendCommand(CommandInterface $command)
63-
{
64-
$request = clone $this->request;
65-
66-
$request->getBody()->write(json_encode(
63+
{
64+
$body = new \Zend\Diactoros\Stream('php://temp', 'w+');
65+
$body->write(json_encode(
6766
array(
6867
'method' => $command->getMethod(),
6968
'params' => $command->getParameters(),
7069
'id' => $command->getId(),
7170
)
7271
));
7372

73+
$request = $this->request->withBody($body);
74+
7475
/** @var \Psr\Http\Message\ResponseInterface */
7576
$this->response = $this->driver->execute($request);
7677

0 commit comments

Comments
 (0)