// keep current flashes for one more request if using AutoExpireFlashBag
$session->
getFlashBag()->
setAll($session->
getFlashBag()->
peekAll());
} $response->
setContent($this->twig->
render('@WebProfiler/Profiler/toolbar_redirect.html.twig',
['location' =>
$response->headers->
get('Location'
), 'host' =>
$request->
getSchemeAndHttpHost()]));
$response->
setStatusCode(200
);
$response->headers->
remove('Location'
);
} if (self::DISABLED ===
$this->mode
|| !
$response->headers->
has('X-Debug-Token'
) ||
$response->
isRedirection() || ($response->headers->
has('Content-Type'
) && !
str_contains($response->headers->
get('Content-Type'
) ?? '', 'html'
)) || 'html' !==
$request->
getRequestFormat() || false !==
stripos($response->headers->
get('Content-Disposition', ''
), 'attachment;'
) ) { return;
} $this->
injectToolbar($response,
$request,
$nonces);
} /**
* Injects the web debug toolbar into the given Response.
*/