8000 bug #14609 [DebugBundle] Remove inlined dumps on XHR (nicolas-grekas) · symfony/symfony@18eef21 · GitHub
[go: up one dir, main page]

Skip to content

Commit 18eef21

Browse files
bug #14609 [DebugBundle] Remove inlined dumps on XHR (nicolas-grekas)
This PR was merged into the 2.6 branch. Discussion ---------- [DebugBundle] Remove inlined dumps on XHR | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | partially #14608 | License | MIT | Doc PR | - Commits ------- d0eb208 [DebugBundle] Remove inlined dumps on XHR
2 parents 52ba805 + d0eb208 commit 18eef21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ public function dump(Data $data)
135135

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

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

0 commit comments

Comments
 (0)
0