8000 bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicol… · symfony/symfony@a0cdcb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit a0cdcb0

Browse files
committed
bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [HttpKernel] Dont close the reponse stream in debug | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19078 | License | MIT | Doc PR | - Because it's `terminate`'s job to clean the state, not the `Response`'s, and because the current behavior prevents getting any output on trailing errors on FPM especially. Commits ------- 2fbc200 [HttpKernel] Dont close the output stream in debug
2 parents 9c8a3e9 + 2fbc200 commit a0cdcb0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,6 @@ public function send()
373373
$this->sendHeaders();
374374
$this->sendContent();
375375

376-
if (function_exists('fastcgi_finish_request')) {
377-
fastcgi_finish_request();
378-
} elseif ('cli' !== PHP_SAPI) {
379-
static::closeOutputBuffers(0, true);
380-
}
381-
382376
return $this< 8000 /span>;
383377
}
384378

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ public function terminate(Request $request, Response $response)
149149
}
150150

151151
if ($this->getHttpKernel() instanceof TerminableInterface) {
152+
if (!$this->debug) {
153+
if (function_exists('fastcgi_finish_request')) {
154+
fastcgi_finish_request();
155+
} elseif ('cli' !== PHP_SAPI) {
156+
Response::closeOutputBuffers(0, true);
157+
}
158+
}
159+
152160
$this->getHttpKernel()->terminate($request, $response);
153161
}
154162
}

0 commit comments

Comments
 (0)
0