8000 [DebugBundle] Remove inlined dumps on XHR by nicolas-grekas · Pull Request #14609 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DebugBundle] Remove inlined dumps on XHR #14609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[DebugBundle] Remove inlined dumps on XHR
  • Loading branch information
nicolas-grekas committed May 12, 2015
commit d0eb2083588317de0af0441f996cc0bc0dad455e
Original file line number Diff line number Diff line change
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