Skip to content

Commit

Permalink
fix: undefined method isMasterRequest (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlienaud authored Dec 9, 2022
1 parent 36ab02d commit f477eee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions EventListener/GoogleTagManagerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ private function allowRender(mixed $event): bool
return false;
}

// only append to master request
if (!$event->isMasterRequest()) {
// only append to main request (symfony >= 5)
if ($event instanceof \Symfony\Component\HttpKernel\Event\ResponseEvent && !$event->isMainRequest()) {
return false;
}

// only append to master request (symfony < 5)
if ($event instanceof \Symfony\Component\HttpKernel\Event\FilterResponseEvent && !$event->isMasterRequest()) {
return false;
}

Expand Down

0 comments on commit f477eee

Please sign in to comment.