Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[DebugBundle] Remove inlined dumps on XHR
  • Loading branch information
nicolas-grekas committed May 12, 2015
1 parent 49ea81b commit d0eb208
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -135,13 +135,13 @@ public function dump(Data $data)

public function collect(Request $request, Response $response, \Exception $exception = null)
{
if ($this->requestStack && $this->requestStack->getMasterRequest() !== $request) {
// Sub-requests and programmatic calls stay in the collected profile.
if (($this->requestStack && $this->requestStack->getMasterRequest() !== $request) || $request->isXmlHttpRequest() || $request->headers->has('Origin')) {
return;
}

// In all conditions that remove the web debug toolbar, dumps are written on the output.
// In all other conditions that remove the web debug toolbar, dumps are written on the output.
if (!$this->requestStack
|| $request->isXmlHttpRequest()
|| !$response->headers->has('X-Debug-Token')
|| $response->isRedirection()
|| ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))
Expand Down

0 comments on commit d0eb208

Please sign in to comment.