public function handle($request, Closure $next)
{
$response = $next($request);
if (!$response instanceof Response) {
return $response;
}
if (!$this->containsBodyTag($response)) {
return $response;
}
return $this->addCookieConsentScriptToResponse($response);
}