Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Neos.Flow/Classes/Mvc/ActionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ public function getHttpHeader(string $headerName)
public function getContent(): string
{
$content = $this->content->getContents();
$this->content->rewind();
if ($this->content->isSeekable()) {
$this->content->rewind();
}
return $content;
}

Expand Down
10 changes: 4 additions & 6 deletions Neos.Http.Factories/Classes/StreamFactoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

namespace Neos\Http\Factories;

use GuzzleHttp\Psr7\BufferStream;
use GuzzleHttp\Psr7\Stream;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\StreamInterface;

/**
Expand All @@ -17,11 +17,9 @@ trait StreamFactoryTrait
*/
public function createStream(string $content = ''): StreamInterface
{
$fileHandle = fopen('php://temp', 'r+');
fwrite($fileHandle, $content);
rewind($fileHandle);

return $this->createStreamFromResource($fileHandle);
$stream = new BufferStream();
$stream->write($content);
return $stream;
}

/**
Expand Down