Skip to content

Commit

Permalink
Merge branch '1.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed May 15, 2024
2 parents a070c99 + 8e8184d commit 1b1e4ab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/web/ResponseEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
use yii\web\Response as YiiResponse;
use yii\web\ServerErrorHttpException;

/**
* @property Response $response
*/
class ResponseEventHandler
{
protected Response $response;

public function __construct()
{
$this->response = Craft::$app->getResponse();
Expand All @@ -38,7 +37,7 @@ public function gzip(): void
Craft::$app->getRequest()->getHeaders()->get('Accept-Encoding') ?? ''
);

if (Collection::make($accepts)->doesntContain('gzip')) {
if (Collection::make($accepts)->doesntContain('gzip') || $this->response->content === null) {
return;
}

Expand Down

0 comments on commit 1b1e4ab

Please sign in to comment.