[WebProfiler] Normalize header name and use a single reference

This commit is contained in:
Victor Berchet 2011-01-11 16:47:13 +01:00 committed by Fabien Potencier
parent 0bc6d814c3
commit 40dac2363e

View File

@ -53,8 +53,8 @@ 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><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'))
sprintf('<html><head></head><body><h1>This Request redirects to<br /><a href="%1$s">%1$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->setStatusCode(200);
$response->headers->remove('Location');