On 18.02.2011 03:13, Jay wrote:
> For every esi request in our application while its in dev/debug mode,
> the toolbar will render under that esi request. So if our page has 4
> esi tags, we'll get 5 toolbars. This obviously messes up the rendering
> of our website a bit on our dev platform.
>
> Tried to fix this myself by setting headers or checking the request
> type to see if it was a master request, but it appears even those esi
> requests are master requests.
>
> Fabien, how can we modify this if statement to not render the toolbar?
>
> if (!$response->headers->has('X-Debug-Token')
> || '3' === substr($response->getStatusCode(), 0, 1)
> || ($response->headers->has('Content-Type') && false ===
> strpos($response->headers->get('Content-Type'), 'html'))
> || 'html' !== $request->getRequestFormat()
> || $request->isXmlHttpRequest()
> ) {
> return $response;
> }
Try and var_dump $_SERVER at that point. Inside the sub-requests I'm
pretty sure varnish sends some headers but I'm not sure what they're
called anymore. Once you found the right value just add it to the if via
$request->server->has() or the like (and send a pull request:)
Cheers
--
Jordi Boggiano
@seldaek :: http://seld.be/
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en