Skip to content

Commit

Permalink
[WebProfilerBundle] fixed redirection interceptions (we must keep as …
Browse files Browse the repository at this point in the history
…many headers as possible)
  • Loading branch information
fabpot committed Nov 9, 2010
1 parent 7b02766 commit 4cd5b2b
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -52,14 +52,12 @@ public function handle(Event $event, Response $response)
}

if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) {
$r = new Response();
$r->setContent(
$response->setContent(
sprintf('<html><head></head><body><h1>This Request redirects to<br /><a href="%s">%s</a>.</h1></body></html>',
$response->headers->get('location'), $response->headers->get('location'))
);
$r->headers->set('X-Debug-Token', $response->headers->get('X-Debug-Token'));

$response = $r;
$response->setStatusCode(200);
$response->headers->delete('Location');
}

$request = $event->getParameter('request');
Expand Down

0 comments on commit 4cd5b2b

Please sign in to comment.