Browse Source

[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.
Ryan Weaver 14 years ago
parent
commit
9b10c8a866

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php

@@ -53,7 +53,7 @@ class WebDebugToolbarListener
 
 
         if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) {
         if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) {
             $response->setContent(
             $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->headers->get('location'), $response->headers->get('location'))
             );
             );
             $response->setStatusCode(200);
             $response->setStatusCode(200);