[WebProfileBundle] Adding more information to the Response content returned when an intercept is redirected.

Since this is a debug-only feature, I think the more details we can include, the less trouble it'll cause when people are not expecting their requests to be intercepted. It's a good feature - this better-communicates what's happening.
This commit is contained in:
Ryan Weaver 2011-01-03 20:20:44 -06:00 committed by Fabien Potencier
parent 5c6f4fbdd7
commit 9b10c8a866

View File

@ -53,7 +53,7 @@ class WebDebugToolbarListener
if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) {
$response->setContent(
sprintf('<html><head></head><body><h1>This Request redirects to<br /><a href="%s">%s</a>.</h1></body></html>',
sprintf('<html><head></head><body><h1>This Request redirects to<br /><a href="%s">%s</a>.</h1><h4>The redirect was intercepted by the web debug toolbar to help debugging.<br/>For more information, see the "intercept-redirects" option of the Profiler.</h4></body></html>',
$response->headers->get('location'), $response->headers->get('location'))
);
$response->setStatusCode(200);