Skip to content

Commit 2dc271c

Browse files
authored
Merge pull request #2 from swilla/master
Make sure stream is seekable before using 'rewind()'
2 parents 6cfc120 + 248e8f1 commit 2dc271c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Responses/SymfonyResponseFactory.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public function create(FilesystemInterface $cache, $path)
4646
}
4747

4848
$response->setCallback(function () use ($stream) {
49-
rewind($stream);
49+
if (ftell($stream) !== 0) {
50+
rewind($stream);
51+
}
5052
fpassthru($stream);
5153
fclose($stream);
5254
});

0 commit comments

Comments
 (0)