BinaryFileResponse gets corrupted in addTag method

Created on 21 February 2023, almost 2 years ago

The GoogleTagResponseSubscriber::addTag method processes every response. This is problematic, because binary response content needs to be zero in \Symfony\Component\HttpFoundation\BinaryFileResponse::setContent, otherwise LogicException: The content cannot be set on a BinaryFileResponse instance. is thrown.

Solution

    if ($response instanceof BinaryFileResponse) {
      return;
    }

needs to be added near the beginning of GoogleTagResponseSubscriber::addTag method.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇨🇿Czech Republic milos.kroulik

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024