Skip to content

Commit 3f1cf3d

Browse files
author
Nick Goris
committed
The content cannot be set on a StreamedResponse instance.
1 parent 360e47d commit 3f1cf3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Middleware/MinifyResponse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Closure;
66
use Nckg\Minify\Minifier;
7+
use Symfony\Component\HttpFoundation\StreamedResponse;
78

89
class MinifyResponse
910
{
@@ -20,7 +21,7 @@ public function handle($request, Closure $next)
2021
/** @var Response $response */
2122
$response = $next($request);
2223

23-
if (!app()->isLocal()) {
24+
if (!app()->isLocal() and false === is_a($response, StreamedResponse::class)) {
2425
$response->setContent((new Minifier())->html($response->getContent()));
2526
}
2627

0 commit comments

Comments
 (0)