Skip to content

Commit aab744a

Browse files
authored
Merge pull request #2 from magento-research/bug/stream-responses
Fix Stream Responses
2 parents f2b6196 + eda438d commit aab744a

File tree

1 file changed

+3
-1
lines changed
  • app/code/Magento/UpwardConnector/Controller

1 file changed

+3
-1
lines changed

app/code/Magento/UpwardConnector/Controller/Upward.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\App\ResponseInterface;
1313
use Magento\Framework\HTTP\PhpEnvironment\Response;
1414
use Magento\Upward\Controller as UpwardController;
15+
use Zend\Http\Response\Stream;
1516

1617
class Upward implements FrontControllerInterface
1718
{
@@ -47,9 +48,10 @@ public function dispatch(RequestInterface $request)
4748
{
4849
/** @var \Zend\Http\Response $upwardResponse */
4950
$upwardResponse = ($this->upwardController)();
51+
$content = $upwardResponse instanceof Stream ? $upwardResponse->getBody() : $upwardResponse->getContent();
5052
$this->response->setHeaders($upwardResponse->getHeaders());
5153
$this->response->setStatusCode($upwardResponse->getStatusCode());
52-
$this->response->setContent($upwardResponse->getContent());
54+
$this->response->setContent($content);
5355
return $this->response;
5456
}
5557
}

0 commit comments

Comments
 (0)